/// <summary> /// 面積圖-时间在键值对里 /// </summary> public void GetSample3() { this.Tittle = "SampleChart_面積圖"; this.ChartTitle = "主标题"; this.ChartSubTitle = "副标题"; XAxis _XAxis = new XAxis(); _XAxis.Title = "X轴标题"; _XAxis.XAxisType = XAxisType.datetime; this.XAxis = _XAxis; this.Tooltip = "%"; Yaxis _YAxis = new Yaxis(); _YAxis.Title = "Y轴标题"; this.YAxis = _YAxis; ChartData ChartData1 = new ChartData(); ChartData1.name = "B32S1"; ChartData1.type = ChartType.area.ToString(); PlotOptions PlotOptions = new PlotOptions(); PlotOptions.type = PlotType.datetime; this.Plot = PlotOptions; ChartData1.data = new List <object> { new List <object> { "2018-01-29 08:00:00", 24 }, new List <object> { "2018-01-29 09:00:00", 384 }, new List <object> { "2018-01-29 10:00:00", 64 }, new List <object> { "2018-01-29 11:00:00", 78 }, new List <object> { "2018-01-29 12:00:00", 35 }, new List <object> { "2018-01-29 14:00:00", 235 }, new List <object> { "2018-01-29 15:00:00", 135 }, new List <object> { "2018-01-29 16:00:00", 85 }, new List <object> { "2018-01-29 17:00:00", 56 }, new List <object> { "2018-01-29 18:00:00", 15 }, new List <object> { "2018-01-29 19:00:00", 133 } }; List <ChartData> _ChartDatas = new List <ChartData> { ChartData1 }; this.ChartDatas = _ChartDatas; }
/// <summary> /// 折線圖-给定开始时间和时间间隔; /// </summary> public void GetSample1() { this.Tittle = "SampleChart_柱狀圖"; this.ChartTitle = "主标题"; this.ChartSubTitle = "副标题"; XAxis _XAxis = new XAxis(); _XAxis.Title = "X轴标题"; _XAxis.XAxisType = XAxisType.datetime; this.XAxis = _XAxis; this.Tooltip = "%"; Yaxis _YAxis = new Yaxis(); _YAxis.Title = "Y轴标题"; this.YAxis = _YAxis; ChartData ChartData1 = new ChartData(); ChartData1.name = "HWD 各線別產出"; ChartData1.type = ChartType.column.ToString(); ChartData1.colorByPoint = true; ChartData1.data = new List <object> { new columnData() { name = "B32S1", y = 132 }, new columnData() { name = "B32S2", y = 245 }, new columnData() { name = "B32S3", y = 45 }, new columnData() { name = "B32S4", y = 315 }, new columnData() { name = "B32S5", y = 35 }, new columnData() { name = "B32S6", y = 183 } }; List <ChartData> _ChartDatas = new List <ChartData> { ChartData1 }; this.ChartDatas = _ChartDatas; }
/// <summary> /// 折線圖-给定开始时间和时间间隔; /// </summary> public void GetSample1() { this.Tittle = "SampleChart_折線圖"; this.ChartTitle = "主标题"; this.ChartSubTitle = "副标题"; XAxis _XAxis = new XAxis(); _XAxis.Title = "X轴标题"; _XAxis.XAxisType = XAxisType.datetime; this.XAxis = _XAxis; this.Tooltip = "%"; Yaxis _YAxis = new Yaxis(); _YAxis.Title = "Y轴标题"; this.YAxis = _YAxis; ChartData ChartData1 = new ChartData(); ChartData1.name = "B32S1"; ChartData1.type = ChartType.line.ToString(); PlotOptions PlotOptions = new PlotOptions(); PlotOptions.type = PlotType.datetime; PlotOptions.pointStartDateTime = DateTime.Now; PlotOptions.pointInterval = 3600000; this.Plot = PlotOptions; ChartData1.data = new List <object> { 96, 88, 179, 139, 254, 34, 101, 459, 179, 341, 578 }; List <ChartData> _ChartDatas = new List <ChartData> { ChartData1 }; this.ChartDatas = _ChartDatas; }