public void OnGet()
        {
            var data = Data.TestData.Data2Dim.ToDataTable(conf =>
            {
                conf.AddColumn(ColumnType.Number, x => x.Item1);
                conf.AddColumn(ColumnType.Number, x => x.Item2);
            });

            DataJson = data.ToJson();


            var options = new LineChartOptions
            {
                Height = 200,
                Width  = 500,
                Title  = "My linechart"
            };

            OptionsJson = options.ToJson();
        }
Ejemplo n.º 2
0
        public void OnGet()
        {
            int i    = 0;
            var data = Data.TestData.Data2DimRandom.ToDataTable(conf =>
            {
                conf.AddColumn(ColumnType.Number, x => i++);
                conf.AddColumn(ColumnType.Number, x => i++);
                conf.AddColumn(x => x.Item1 < 10 ? default(int?) : x.Item1);
                conf.AddColumn(ColumnType.Number, x => x.Item1 < 20 ? default(int?) : x.Item1 + 5);
                conf.AddColumn(x => x.Item2);
            });

            DataJson = data.ToJson();


            var options = new LineChartOptions
            {
                Height = 200,
                Width  = 500,
                Title  = "My linechart"
            };

            OptionsJson = options.ToJson();
        }
        public void OnGet()
        {
            var data = Data.TestData.Data2Dim.ToDataTable(conf =>
            {
                conf.AddColumn(ColumnType.Number, x => x.Item1);
                conf.AddColumn(ColumnType.Number, x => x.Item2);
                conf.AddColumn(ColumnType.Boolean, ColumnRole.Emphasis, x => x.Item2 > 20);
                conf.AddColumn(ColumnType.Boolean, ColumnRole.Certainty, x => x.Item2 < 30);
                conf.AddColumn(ColumnType.Number, ColumnRole.Interval, x => x.Item2 * 0.8);
                conf.AddColumn(ColumnType.Number, ColumnRole.Interval, x => x.Item2 * 1.2);
            });

            DataJson = data.ToJson();


            var options = new LineChartOptions
            {
                Height = 200,
                Width  = 500,
                Title  = "Linechart with role columns"
            };

            OptionsJson = options.ToJson();
        }