首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > JavaScript >

关于highchart曲线 后盾赋值

2013-07-04 
关于highchart曲线 后台赋值Hashtable ht new Hashtable()//ht.Add(name, hello_world)//ht.Add(

关于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 貌似不行  数组貌似也不行

热点排行