In the data statistics and analysis business, sometimes the customer needs to be in a chart of the histogram, pie chart, graphs are reflected, that is, you can see the specific data from the histogram, but also from the graph to see the trend of change, as well as from the pie chart to see the proportion of each part of the data. Highcharts can easily achieve the effect of three graphs in unity.
Copy Code code as follows:
var chart;
$ (document). Ready (function () {
Chart = new Highcharts.chart ({
Chart: {
Renderto: ' Container ',
Defaultseriestype: ' Area '
},
Title: {
Text: ' Historic and estimated worldwide Population growth by Region '
},
Subtitle: {
Text: ' Source:Wikipedia.org '
},
Xaxis: {
Categories: [' 1750 ', ' 1800 ', ' 1850 ', ' 1900 ', ' 1950 ', ' 1999 ', ' 2050 '],
Tickmarkplacement: ' On ',
Title: {
Enabled:false
}
},
YAxis: {
Title: {
Text: ' Billions '
},
Labels: {
Formatter:function () {
return this.value/1000;
}
}
},
ToolTip: {
Formatter:function () {
Return ' +
This.x + ': ' + highcharts.numberformat (this.y, 0, ', ') + ' millions ';
}
},
Plotoptions: {
Area: {
Stacking: ' Normal ',
LineColor: ' #666666 ',
Linewidth:1,
Marker: {
Linewidth:1,
LineColor: ' #666666 '
}
}
},
Series: [{
Name: ' Asia ',
Data: [502, 635, 809, 947, 1402, 3634, 5268]
}, {
Name: ' Africa ',
Data: [106, 107, 111, 133, 221, 767, 1766]
}, {
Name: ' Europe ',
Data: [163, 203, 276, 408, 547, 729, 628]
}, {
Name: ' America ',
Data: [18, 31, 54, 156, 339, 818, 1201]
}, {
Name: ' Oceania ',
Data: [2, 2, 2, 6, 13, 30, 46]
}]
});
});
That's all we have in this article, and I hope it helps to draw a pie chart graph with jquery.