Beispiel #1
0
        protected void InitializeChart()
        {
            this.chartControl1.Series.Clear();

            ChartSeries series1 = new ChartSeries("Market");

            series1.Name = "Market";
            series1.Text = series1.Name;

            series1.Points.Add(0, 20, 50, 25, 25);//Only first Y value will be used by ColumnChart
            series1.Points.Add(1, 22, 50, 25, 35);
            series1.Points.Add(2, 23, 50, 25, 20, 20);
            series1.Points.Add(3, 24, 50, 25, 45);


            this.chartControl1.PrimaryXAxis.LabelsImpl = new LabelModel(new string[] { "", "SUV", "Car", "Pickup", "Minivan" });
            this.chartControl1.PrimaryXAxis.ValueType  = ChartValueType.Custom;

            series1.Type = ChartSeriesType.Column;
            this.chartControl1.Series.Add(series1);
            this.chartControl1.Titles[0].Text = "Automobile Sales by Category";

            this.chartControl1.SmoothingMode  = System.Drawing.Drawing2D.SmoothingMode.Default;
            this.chartControl1.Legend.Visible = false;
            this.chartControl1.Series[0].Style.Border.Color = Color.Transparent;
            ChartAppearance.ApplyChartStyles(this.chartControl1);
        }
Beispiel #2
0
 private void Form1_Load(object sender, System.EventArgs e)
 {
     InitializeChart();
     ChartAppearance.ApplyChartStyles(this.chartControl1);
     this.chartControl1.Indexed = true;
     this.chartControl1.Dock    = DockStyle.Fill;
 }
Beispiel #3
0
 private void Form1_Load(object sender, System.EventArgs e)
 {
     InitializeChart();
     ChartAppearance.ApplyChartStyles(this.chartControl1);
     this.chartControl1.Indexed = true;
     this.chartControl1.Anchor  = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
                                                                         | System.Windows.Forms.AnchorStyles.Left)
                                                                        | System.Windows.Forms.AnchorStyles.Right)));
 }
Beispiel #4
0
        private void chartControl1_ChartRegionClick(object sender, Syncfusion.Windows.Forms.Chart.ChartRegionMouseEventArgs e)
        {
            if (e.Region.IsChartPoint)
            {
                if (!isDrilledDown)
                {
                    InitializeDrillDownChart(e.Region.PointIndex);

                    this.label1.Text = "Click on the pie to go back and view \n 'Sales by category'";
                }
                else
                {
                    InitializeChart();

                    this.label1.Text = "Click on the columns to drill down further";
                }
                isDrilledDown = !isDrilledDown;
            }
            ChartAppearance.ApplyChartStyles(this.chartControl1);

            this.chartControl1.Refresh();
        }