<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