Example #1
0
 /// <summary>
 /// ChartJsBuilder constructor
 /// </summary>
 /// <param name="chartVariableName">The name of the Javascript variable that has the HTML <canvas> element where the chart will be used. </param>
 public ChartJsBuilder(string chartVariableName)
 {
     randomColorGenerator  = new RandomColorGenerator();
     chartValidator        = new ChartValidator();
     chartJsonHelper       = new ChartJsonHelper(chartVariableName);
     defaultChartGenerator = new DefaultChartGenerator();
 }
 public LineDataStepsBuilder(IRandomColorGenerator randomColorGenerator, IChartValidator chartValidator, IChartJsonHelper chartJsonHelper, IDefaultChartGenerator defaultChartGenerator)
 {
     this.randomColorGenerator  = randomColorGenerator;
     this.chartValidator        = chartValidator;
     this.chartJsonHelper       = chartJsonHelper;
     this.defaultChartGenerator = defaultChartGenerator;
 }
Example #3
0
 public BarDataStepsBuilder(IRandomColorGenerator randomColorGenerator, IChartValidator chartValidator, IChartJsonHelper chartJsonHelper, IDefaultChartGenerator defaultChartGenerator, bool isHorizontal = false)
 {
     this.randomColorGenerator  = randomColorGenerator;
     this.chartValidator        = chartValidator;
     this.chartJsonHelper       = chartJsonHelper;
     this.defaultChartGenerator = defaultChartGenerator;
     this.isHorizontal          = isHorizontal;
 }
Example #4
0
 public DoughnutDataStepsBuilder(IRandomColorGenerator randomColorGenerator, IChartValidator chartValidator, IChartJsonHelper chartJsonHelper, IDefaultChartGenerator defaultChartGenerator, bool isPie = false)
 {
     this.randomColorGenerator  = randomColorGenerator;
     this.chartValidator        = chartValidator;
     this.chartJsonHelper       = chartJsonHelper;
     this.defaultChartGenerator = defaultChartGenerator;
     this.isPie = isPie;
 }
        public LineDataBuilder(IRandomColorGenerator randomColorGenerator, IChartValidator chartValidator, IChartJsonHelper chartJsonHelper, IDefaultChartGenerator defaultChartGenerator)
        {
            this.randomColorGenerator  = randomColorGenerator;
            this.chartValidator        = chartValidator;
            this.chartJsonHelper       = chartJsonHelper;
            this.defaultChartGenerator = defaultChartGenerator;

            data = new Data <LineDataset>
            {
                Datasets = new List <LineDataset>()
            };
        }
Example #6
0
        public BarDataBuilder(IRandomColorGenerator randomColorGenerator, IChartValidator chartValidator, IChartJsonHelper chartJsonHelper, IDefaultChartGenerator defaultChartGenerator, bool isHorizontal = false)
        {
            this.randomColorGenerator  = randomColorGenerator;
            this.chartValidator        = chartValidator;
            this.chartJsonHelper       = chartJsonHelper;
            this.defaultChartGenerator = defaultChartGenerator;
            this.isHorizontal          = isHorizontal;

            data = new Data <BarDataset>
            {
                Datasets = new List <BarDataset>()
            };
        }
Example #7
0
        public DoughnutDataBuilder(IRandomColorGenerator randomColorGenerator, IChartValidator chartValidator, IChartJsonHelper chartJsonHelper, IDefaultChartGenerator defaultChartGenerator, bool isPie = false)
        {
            this.randomColorGenerator  = randomColorGenerator;
            this.chartValidator        = chartValidator;
            this.chartJsonHelper       = chartJsonHelper;
            this.defaultChartGenerator = defaultChartGenerator;
            this.isPie = isPie;

            data = new Data <DoughnutDataset>
            {
                Datasets = new List <DoughnutDataset>()
            };
        }
Example #8
0
 public BubbleChartBuilder(IDefaultChartGenerator defaultChartGenerator, IChartValidator chartValidator, IChartJsonHelper chartJsonHelper, Data <BubbleDataset> data) : base(defaultChartGenerator, chartValidator, chartJsonHelper)
 {
     base.Chart      = defaultChartGenerator.GenerateBubbleChart();
     base.Chart.Data = data;
 }
 public HorizontalBarChartBuilder(IDefaultChartGenerator defaultChartGenerator, IChartValidator chartValidator, IChartJsonHelper chartJsonHelper, Data <BarDataset> data) : base(defaultChartGenerator, chartValidator, chartJsonHelper, data)
 {
     Chart        = defaultChartGenerator.GenerateHorizontalBarChart();
     ChartOptions = (BarChartOptions)Chart.Options;
     Chart.Data   = data;
 }
Example #10
0
 public RadarChartBuilder(IDefaultChartGenerator defaultChartGenerator, IChartValidator chartValidator, IChartJsonHelper chartJsonHelper, Data <RadarDataset> data) : base(defaultChartGenerator, chartValidator, chartJsonHelper)
 {
     Chart      = defaultChartGenerator.GenerateRadarChart();
     radarScale = (RadarOptionsScale)Chart.Options.Scales;
     Chart.Data = data;
 }
Example #11
0
 public PieChartBuilder(IDefaultChartGenerator defaultChartGenerator, IChartValidator chartValidator, IChartJsonHelper chartJsonHelper, Data <DoughnutDataset> data) : base(defaultChartGenerator, chartValidator, chartJsonHelper, data)
 {
     Chart        = defaultChartGenerator.GeneratePieChart();
     Chart.Data   = data;
     ChartOptions = (DoughnutChartOptions)base.Chart.Options;
 }
Example #12
0
 public BarChartBuilder(IDefaultChartGenerator defaultChartGenerator, IChartValidator chartValidator, IChartJsonHelper chartJsonHelper, Data <BarDataset> data) : base(defaultChartGenerator, chartValidator, chartJsonHelper)
 {
     base.Chart      = defaultChartGenerator.GenerateBarChart();
     base.Chart.Data = data;
     ChartOptions    = (BarChartOptions)Chart.Options;
 }
Example #13
0
 protected ChartBuilder(IDefaultChartGenerator defaultChartGenerator, IChartValidator chartValidator, IChartJsonHelper chartJsonHelper)
 {
     this.defaultChartGenerator = defaultChartGenerator;
     this.chartValidator        = chartValidator;
     this.chartJsonHelper       = chartJsonHelper;
 }