Exemplo n.º 1
0
        public void OnGet()
        {
            var data = Data.TestData.Data1DimWithLabels.ToDataTable(conf =>
            {
                conf.AddColumn(x => x.Item1);
                conf.AddColumn(x => x.Item2);
            });

            DataJson = data.ToJson();


            var options = new PieChartOptions
            {
                Height = 400,
                Width  = 500,
                SliceVisibilityThreshold = 0.05,
                ChartArea = new ChartArea {
                    BackgroundColor = Color.AliceBlue, Left = UnitSize.Percent(5), Width = UnitSize.Percent(90)
                },
                PieHole = 0.5,
                Legend  = new LegendOptions {
                    Position = LegendPosition.None
                }
            };

            OptionsJson = options.ToJson();
        }
Exemplo n.º 2
0
        private PieChartOptions GetIndustryFinanceChartOptions()
        {
            var options = new PieChartOptions();

            options.title           = new PieChartTitle();
            options.title.text      = "Industry Finance";
            options.title.display   = true;
            options.title.fontsize  = 22;
            options.legend          = new PieChartLegend();
            options.legend.position = "bottom";
            return(options);
        }