Highcharts Dynamic Fetch value

Source: Internet
Author: User

<script type= "Text/javascript" >
$ (document). Ready (function () {
var options = {
Chart: {
Renderto: ' Container ',
Defaultseriestype: ' spline ',//Chart type line, spline, area, areaspline, column, bar, Pie, Column,scatter
Inverted:false//left and right display, default up and down forward. If set to true, the horizontal ordinate position is swapped
},
Xaxis: {
Categories:[],
Title: {text: ' Time '}//x axis coordinate title labels: Vertical column ruler
},
YAxis: {
Title: {text: ' clicks '},//y axis coordinates title labels: Vertical column ruler
min:0
},
ToolTip: {
Formatter:function () {
Formatting hints When a data point is mounted on the mouse
Return ' Total number: ' + Highcharts.numberformat (THIS.Y, 1) + ' People <br/> Current time: ' + this.x;
}
},
Credits: {
Enabled:false
},
Plotoptions: {
Column: {
pointpadding:0.2,//Chart column
borderwidth:0//thickness of chart bars
},bar: {
DataLabels: {
Enabled:false
}
}
},
Title: {text: ' Specify time click Statistics '},//Chart main title
Series:[]
};
$ ("#btn"). Click (function () {
$.post ("/tgspreadservlet", {page: "Dayget", sdate:$ ("#sdate"). Val (), edate:$ ("#edate"). Val (), surl:$ ("#sUrl"). Val () },function (data) {
var sd=$ ("#sdate"). Val ();
var ed=$ ("#edate"). Val ();
Calculate the difference in days
var datediff=datediff (SD, ed);
for (Var i=0;i<datediff;i++) {
var s=adddays (sd,i);
Options.xAxis.categories.push (s);
}
Data=eval ("(" +data+ ")");
Options.series.push (data);
var chart=new highcharts.chart (options);
});
});

});

</cript>

Highcharts Dynamic Fetch value

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.