Example #1
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.components = new System.ComponentModel.Container();
     Syncfusion.Windows.Forms.Chart.ChartSeries          chartSeries1          = new Syncfusion.Windows.Forms.Chart.ChartSeries();
     Syncfusion.Windows.Forms.Chart.ChartCustomShapeInfo chartCustomShapeInfo1 = new Syncfusion.Windows.Forms.Chart.ChartCustomShapeInfo();
     Syncfusion.Windows.Forms.Chart.ChartLineInfo        chartLineInfo1        = new Syncfusion.Windows.Forms.Chart.ChartLineInfo();
     System.ComponentModel.ComponentResourceManager      resources             = new System.ComponentModel.ComponentResourceManager(typeof(Form1));
     this.panel1        = new System.Windows.Forms.Panel();
     this.label1        = new System.Windows.Forms.Label();
     this.timer1        = new System.Windows.Forms.Timer(this.components);
     this.toolTip1      = new System.Windows.Forms.ToolTip(this.components);
     this.chartControl1 = new Syncfusion.Windows.Forms.Chart.ChartControl();
     this.panel1.SuspendLayout();
     this.SuspendLayout();
     //
     // panel1
     //
     this.panel1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
                                                                | System.Windows.Forms.AnchorStyles.Right)));
     this.panel1.AutoSize  = true;
     this.panel1.BackColor = System.Drawing.Color.White;
     this.panel1.Controls.Add(this.label1);
     this.panel1.Font     = new System.Drawing.Font("Segoe UI", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.panel1.Location = new System.Drawing.Point(12, 542);
     this.panel1.Name     = "panel1";
     this.panel1.Size     = new System.Drawing.Size(594, 27);
     this.panel1.TabIndex = 1;
     //
     // label1
     //
     this.label1.Dock      = System.Windows.Forms.DockStyle.Bottom;
     this.label1.Font      = new System.Drawing.Font("Segoe UI", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(161)));
     this.label1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(66)))), ((int)(((byte)(66)))));
     this.label1.Location  = new System.Drawing.Point(0, 10);
     this.label1.Name      = "label1";
     this.label1.Size      = new System.Drawing.Size(594, 17);
     this.label1.TabIndex  = 0;
     this.label1.Text      = "Click on the columns to drill down further";
     this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
     //
     // timer1
     //
     this.timer1.Enabled = true;
     //
     // chartControl1
     //
     this.chartControl1.ChartArea.BackInterior   = new Syncfusion.Drawing.BrushInfo(System.Drawing.Color.White);
     this.chartControl1.ChartArea.CursorLocation = new System.Drawing.Point(0, 0);
     this.chartControl1.ChartArea.CursorReDraw   = false;
     this.chartControl1.DataSourceName           = "";
     this.chartControl1.ForeColor    = System.Drawing.SystemColors.ControlText;
     this.chartControl1.IsWindowLess = false;
     //
     //
     //
     this.chartControl1.Legend.Location           = new System.Drawing.Point(830, 75);
     this.chartControl1.Localize                  = null;
     this.chartControl1.Location                  = new System.Drawing.Point(8, 10);
     this.chartControl1.Name                      = "chartControl1";
     this.chartControl1.PrimaryXAxis.Crossing     = double.NaN;
     this.chartControl1.PrimaryXAxis.Title        = "Vehicles";
     this.chartControl1.PrimaryXAxis.Margin       = true;
     this.chartControl1.PrimaryYAxis.Title        = "Sales (%)";
     this.chartControl1.PrimaryYAxis.Crossing     = double.NaN;
     this.chartControl1.PrimaryYAxis.ForceZero    = true;
     this.chartControl1.PrimaryYAxis.Margin       = true;
     chartSeries1.FancyToolTip.ResizeInsideSymbol = true;
     chartSeries1.Name = "Default";
     chartSeries1.Points.Add(0D, ((double)(18D)), ((double)(127D)), ((double)(112D)), ((double)(108D)));
     chartSeries1.Points.Add(1D, ((double)(56D)), ((double)(73D)), ((double)(61D)), ((double)(56D)));
     chartSeries1.Points.Add(2D, ((double)(4D)), ((double)(212D)), ((double)(82D)), ((double)(107D)));
     chartSeries1.Points.Add(3D, ((double)(50D)), ((double)(348D)), ((double)(55D)), ((double)(190D)));
     chartSeries1.Points.Add(4D, ((double)(87D)), ((double)(246D)), ((double)(136D)), ((double)(192D)));
     chartSeries1.Resolution          = 0D;
     chartSeries1.StackingGroup       = "Default Group";
     chartSeries1.Style.AltTagFormat  = "";
     chartSeries1.Style.DrawTextShape = false;
     chartLineInfo1.Alignment         = System.Drawing.Drawing2D.PenAlignment.Center;
     chartLineInfo1.Color             = System.Drawing.SystemColors.ControlText;
     chartLineInfo1.DashPattern       = null;
     chartLineInfo1.DashStyle         = System.Drawing.Drawing2D.DashStyle.Solid;
     chartLineInfo1.Width             = 1F;
     chartCustomShapeInfo1.Border     = chartLineInfo1;
     chartCustomShapeInfo1.Color      = System.Drawing.SystemColors.HighlightText;
     chartCustomShapeInfo1.Type       = Syncfusion.Windows.Forms.Chart.ChartCustomShape.Square;
     chartSeries1.Style.TextShape     = chartCustomShapeInfo1;
     chartSeries1.Text = "Default";
     this.chartControl1.Series.Add(chartSeries1);
     this.chartControl1.Size     = new System.Drawing.Size(934, 526);
     this.chartControl1.TabIndex = 2;
     this.chartControl1.Text     = "chartControl1";
     //
     //
     //
     this.chartControl1.Title.ForeColor = System.Drawing.SystemColors.ControlText;
     this.chartControl1.Title.Name      = "Default";
     this.chartControl1.Titles.Add(this.chartControl1.Title);
     this.chartControl1.ChartRegionClick      += new Syncfusion.Windows.Forms.Chart.ChartRegionMouseEventHandler(this.chartControl1_ChartRegionClick);
     this.chartControl1.ChartRegionMouseHover += new Syncfusion.Windows.Forms.Chart.ChartRegionMouseEventHandler(this.chartControl1_ChartRegionMouseHover);
     //
     // Form1
     //
     this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
     this.BackColor         = System.Drawing.Color.White;
     this.ClientSize        = new System.Drawing.Size(954, 581);
     this.Controls.Add(this.chartControl1);
     this.Controls.Add(this.panel1);
     this.Icon          = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
     this.MinimumSize   = new System.Drawing.Size(461, 407);
     this.Name          = "Form1";
     this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
     this.Text          = "Drilldown";
     this.Load         += new System.EventHandler(this.Form1_Load);
     this.panel1.ResumeLayout(false);
     this.ResumeLayout(false);
     this.PerformLayout();
 }
Example #2
0
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            Syncfusion.Windows.Forms.Chart.ChartSeries chartSeries1 = new Syncfusion.Windows.Forms.Chart.ChartSeries();
            this.chartControl1 = new Syncfusion.Windows.Forms.Chart.ChartControl();
            this.SuspendLayout();
            //
            // chartControl1
            //
            this.chartControl1.ChartArea.BackInterior   = new Syncfusion.Drawing.BrushInfo(System.Drawing.Color.Transparent);
            this.chartControl1.ChartArea.CursorLocation = new System.Drawing.Point(0, 0);
            this.chartControl1.ChartArea.CursorReDraw   = false;
            this.chartControl1.DataSourceName           = "[none]";
            this.chartControl1.IsWindowLess             = false;
            this.chartControl1.Title.Text = "Product Sales";
            this.chartControl1.Size       = new System.Drawing.Size(457, 330);
            this.chartControl1.TabIndex   = 0;
            this.chartControl1.Title.Name = "Default";
            this.chartControl1.Titles.Add(this.chartControl1.Title);
            this.chartControl1.Skins                   = Skins.Metro;
            this.chartControl1.ShowToolTips            = true;
            this.chartControl1.Tooltip.BackgroundColor = new BrushInfo(Color.White);
            this.chartControl1.Tooltip.BorderStyle     = BorderStyle.FixedSingle;
            this.chartControl1.Tooltip.Font            = new Font("Segoe UI", 10);

            //
            // Legend
            //
            this.chartControl1.Legend.Visible   = true;
            this.chartControl1.LegendAlignment  = ChartAlignment.Center;
            this.chartControl1.Legend.Position  = ChartDock.Top;
            this.chartControl1.LegendsPlacement = ChartPlacement.Outside;
            this.chartControl1.Legend.Location  = new System.Drawing.Point(321, 87);
            this.chartControl1.Localize         = null;
            this.chartControl1.Location         = new System.Drawing.Point(174, 87);
            //
            // PrimaryXAxis
            //
            this.chartControl1.PrimaryXAxis.Title      = "Year";
            this.chartControl1.PrimaryXAxis.ValueType  = ChartValueType.Category;
            this.chartControl1.PrimaryXAxis.TitleColor = System.Drawing.SystemColors.ControlText;
            //
            // PrimaryYAxis
            //
            this.chartControl1.PrimaryYAxis.Title      = "Sales(Millions)";
            this.chartControl1.PrimaryYAxis.TitleColor = System.Drawing.SystemColors.ControlText;
            //
            // Form1
            //
            BindingList <SalesData> dataSource = new BindingList <SalesData>();

            dataSource.Add(new SalesData("1999", 5));
            dataSource.Add(new SalesData("2000", 7));
            dataSource.Add(new SalesData("2001", 12));
            dataSource.Add(new SalesData("2002", 18));
            dataSource.Add(new SalesData("2003", 22));
            dataSource.Add(new SalesData("2004", 30));
            dataSource.Add(new SalesData("2005", 40));
            dataSource.Add(new SalesData("2006", 50));
            dataSource.Add(new SalesData("2007", 65));
            dataSource.Add(new SalesData("2008", 75));

            CategoryAxisDataBindModel dataSeriesModel = new CategoryAxisDataBindModel(dataSource);

            dataSeriesModel.CategoryName = "Year";
            dataSeriesModel.YNames       = new string[] { "Sales" };

            var template = new ChartTemplate(typeof(ChartControl));

            template.Scan(this.chartControl1);
            template.Save("TemplateName.xml");

            //ChartTemplate.Save(this.chartControl1, "TemplateName.xml");

            chartSeries1 = new ChartSeries("Sales");
            chartSeries1.PointsToolTipFormat   = "{2}";
            chartSeries1.PrepareStyle         += ChartSeries1_PrepareStyle;
            chartSeries1.CategoryModel         = dataSeriesModel;
            chartSeries1.Style.DisplayText     = true;
            chartSeries1.Style.TextOrientation = ChartTextOrientation.Up;
            this.chartControl1.Dock            = DockStyle.Fill;
            this.chartControl1.Series.Add(chartSeries1);

            this.chartControl1.Dock  = System.Windows.Forms.DockStyle.Fill;
            this.chartControl1.Size  = new System.Drawing.Size(600, 450);
            this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F);
            this.AutoScaleMode       = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize          = new System.Drawing.Size(821, 577);
            this.Controls.Add(this.chartControl1);
            this.Name = "Form1";
            this.Text = "Form1";
            this.ResumeLayout(false);
        }