The third week of school learning content

 

This week the teacher arranged a nationwide analysis on the number of confirmed outbreaks of the histogram, so learning this week, mainly in echarts above;

About the time echarts the beginning I do not understand, or even the beginning of time I do not know how to complete histogram, I just want to know the value passed to the database interface to go; then after asking the big brother with Baidu search, I know, and came into contact with echarts;

The knock on the code of the time : the two classes spent in class, after class on Wednesday afternoon except echarts part of the rest are completed, and then Thursday morning, learning to write with knock implement echarts, which other branches of the week a lot of work, study time on the code in general, and a lot; hope that the next week to assign a good time with their other subjects of the code;

 

I learned about echarts

1, first introduced echarts.min.js, <Script the src = "echarts.min.js" > </ Script> 

2, to prepare a ECharts width with high DOM container <div ID = "main" style = " width : 600px ; height : 400px ; " > </ div> 

3, ECharts library json format configuration. ECharts can only use json;

    echarts.init(document.getElementById('main')).setOption(option);

. 4, XAXIS: {
              type: 'category'},
             YAXIS: {}, // item axis shows the outer configuration

5, each series to determine their own chart type by type:

  • type: 'bar': columnar / bar
  • type: 'line': polyline / Area FIG.
  • type: 'pie': Pie
  •  Series: [
                     {
                       name: 'confirmed number',
                         type: 'bar',
                         encode: {
                             // the "amount" columns are mapped to the X-axis.
                             x: 'Department',
                             // the "product" column is mapped to the Y axis.
                             y: 'The number of diagnosed'
                         }
                     }]

 

Guess you like

Origin www.cnblogs.com/1234yyf/p/12436428.html