读书人

关于highchart曲线 后盾赋值

发布时间: 2013-07-04 11:45:51 作者: rapoo

关于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')
})



前台取到值了 但图却没有显示。。
highchart的数据格式是要啥样?
直接传json 貌似不行 数组貌似也不行

读书人网 >JavaScript

热点推荐