示例#1
0
 public BasicPie(DataTable dataTable, CompleteOption option, int categoryCol = 1)
 {
     if (!option.legend.FlagDic["orient"])
     {
         option.legend.orient = Option.BaseOption.Orient.horizontal;
         option.legend.left   = "'center'";
     }
     option.dataset = new DataSetSource()
     {
         source = Common.GetDataSetSource(dataTable, categoryCol - 1),
     };
     option.series = new Series(
         new ISeries[] {
         new SeriesPie()
         {
             emphasis = new Option.SeriesType.SeriesBaseOption.Emphasis()
             {
                 itemStyle = new Option.SeriesType.SeriesBaseOption.ItemStyle()
                 {
                     shadowBlur    = 10,
                     shadowOffsetX = 0,
                     shadowColor   = "'rgba(0, 0, 0, 0.5)'",
                 }
             }
         }
     });
     _initScript = option.ToString();
 }
示例#2
0
 public BasicScatter(DataTable dataTable, CompleteOption option, int categoryCol = 1)
 {
     option.xAxis   = new XAxis();
     option.yAxis   = new YAxis();
     option.dataset = new DataSetSource()
     {
         source = Common.GetDataSetSource(dataTable, categoryCol - 1),
     };
     option.series = new Series(Enumerable.Repeat(new SeriesScatter(), dataTable.Columns.Count - 1).ToArray());
     _initScript   = option.ToString();
 }
示例#3
0
 public BasicLineChart(DataTable dataTable, CompleteOption option, int categoryCol = 1)
 {
     option.xAxis = new XAxis()
     {
         type = xAxisType.category
     };
     option.yAxis = new YAxis()
     {
         type = Option.BaseOption.xAxisType.value,
     };
     option.dataset = new DataSetSource()
     {
         source = Common.GetDataSetSource(dataTable, categoryCol - 1),
     };
     option.series = new Series(Enumerable.Repeat(new SeriesLine(), dataTable.Columns.Count - 1).ToArray());
     _initScript   = option.ToString();
 }
示例#4
0
 public BasicAreachart(DataTable dataTable, CompleteOption option, int categoryCol = 1)
 {
     option.xAxis = new XAxis()
     {
         type        = Option.BaseOption.xAxisType.category,
         boundaryGap = "'false'",
     };
     option.yAxis = new YAxis()
     {
         type = Option.BaseOption.xAxisType.value,
     };
     option.dataset = new DataSetSource()
     {
         source = Common.GetDataSetSource(dataTable, categoryCol - 1),
     };
     option.series = new Series(
         Enumerable.Repeat(new SeriesLine()
     {
         areaStyle = new Option.SeriesType.LineBaseOption.AreaStyle(),
     }, dataTable.Columns.Count - 1).ToArray());
     _initScript = option.ToString();
 }
示例#5
0
        public StackBar(DataTable dataTable, CompleteOption option, int categoryCol = 1, string stack = "'汇总'")
        {
            option.xAxis = new XAxis()
            {
                type = xAxisType.category
            };
            option.yAxis   = new YAxis();
            option.dataset = new DataSetSource()
            {
                source = Common.GetDataSetSource(dataTable, categoryCol - 1),
            };
            List <ISeries> series = new List <ISeries>();

            //series.Add(new SeriesBar());
            foreach (var ser in Enumerable.Repeat(new SeriesBar()
            {
                stack = stack
            }, dataTable.Columns.Count - 1).ToArray())
            {
                series.Add(ser);
            }
            option.series = new Series(series.ToArray());
            _initScript   = option.ToString();
        }