关于highchart曲线 后台赋值
Hashtable ht = new Hashtable();
//ht.Add("name", "hello_world");
//ht.Add("type", "line");
//ht.Add("threshold", null);
ht.Add("data", ds.Tables[0]);
string strJson = Newtonsoft.Json.JsonConvert.SerializeObject(ht);
Response.Clear();
Response.ContentEncoding = Encoding.UTF8;
Response.ContentType = "application/json";
Response.Write(strJson);
Response.Flush();
Response.End();
$.post("HistoryCurce.aspx", { id: 4, spot: checkedspot }, function (data) {
// alert(series1);
$('#container').highcharts('StockChart', {
chart: {
type: 'line',
marginRight: 130,
marginBottom: 25
},
rangeSelector: {
selected: 1
},
title: {
text: 'demo'
},
xAxis: {
type: 'datetime',
// min: minDate, //0表示1月 以此类推
//max: maxDate,
//tickInterval: 30 * 24 * 3600 * 1000,//X轴点间隔
//labels: {
// align: 'left',
// formatter: function () {
// return Highcharts.dateFormat('%Y%m%d', series2);
// }
//}
},
yAxis: {
type:"float"
},
series: [{
name:"测点",
data: data,
pointStart: Date.UTC(2012, 9, 10),
pointInterval: 24 * 3600 * 1000,// one day
marker: {
enabled: true,
radius: 3
},
shadow: true,
tooltip: {
valueDecimals: 2
}
}]
});
}, 'json')
})