Example #1
0
        /// <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;
        }
Example #2
0
        /// <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;
        }