Ejemplo n.º 1
0
        private void InitializeControls()
        {
            //Set localized text
            baseSample1.lblTitle.Text       = Localizer.GetItem("gettingstarted", "title");
            baseSample1.pDescription.Height = 120;
            baseSample1.tbDescription.Rtf   = Localizer.GetItem("gettingstarted", "description").MakeRtf();

            baseSample1.tbCode.Text = @"// Add 2 data series
var s1 = new Series();
s1.Binding = s1.Name = ""Sales"";
flexChart1.Series.Add(s1);

var s2 = new Series();
s2.Binding = s2.Name = ""Expenses"";
flexChart1.Series.Add(s2);

// Set x-binding and add data to the chart
flexChart1.BindingX = ""Country"";
flexChart1.DataSource = new[]
{
    new { Country = ""UK"", Sales = 5, Expenses = 4},
    new { Country = ""USA"", Sales = 7, Expenses = 3},
    new { Country = ""Germany"", Sales = 8, Expenses = 2},
    new { Country = ""Japan"", Sales = 12, Expenses = 8},
};";

            flexChart1 = baseSample1.flexChart1;
            baseSample1.pControls.Visible = false;
        }
Ejemplo n.º 2
0
 private void InitializeControls()
 {
     //Set localized content
     baseSample1.lblTitle.Text     = Localizer.GetItem("rangedarea", "title");
     baseSample1.tbDescription.Rtf = Localizer.GetItem("rangedarea", "description").MakeRtf();
     flexChart1 = baseSample1.flexChart1;
 }
Ejemplo n.º 3
0
 private void InitializeControls()
 {
     //Set localized content
     baseSample1.lblTitle.Text     = Localizer.GetItem("callouts", "title");
     baseSample1.tbDescription.Rtf = Localizer.GetItem("callouts", "description").MakeRtf();
     baseSample1.pScroll.Controls.Remove(baseSample1.pControls);
     flexChart1 = baseSample1.flexChart1;
 }
        private void InitializeControls()
        {
            #region Init controls

            // Set localized text
            baseSample1.lblTitle.Text       = Localizer.GetItem("selectionmodes", "title");
            baseSample1.pDescription.Height = 90;
            baseSample1.tbDescription.Rtf   = Localizer.GetItem("selectionmodes", "description").MakeRtf();

            baseSample1.tbCode.Text = @"//FlexChart ChartSelectionMode property
flexChart1.SelectionMode = C1.Chart.ChartSelectionMode.Series;";

            flexChart1 = baseSample1.flexChart1;

            // Initialize ChartType combo box
            cbChartType = new ComboBox()
            {
                Width         = 180,
                FlatStyle     = FlatStyle.Flat,
                ForeColor     = Color.DimGray,
                DropDownStyle = ComboBoxStyle.DropDownList
            };
            cbChartType.SelectedIndexChanged += cbChartType_SelectedIndexChanged;

            // Initialize Stacked combo box
            cbSelectionMode = new ComboBox()
            {
                Width         = 180,
                FlatStyle     = FlatStyle.Flat,
                ForeColor     = Color.DimGray,
                DropDownStyle = ComboBoxStyle.DropDownList
            };
            cbSelectionMode.SelectedIndexChanged += cbSelectionMode_SelectedIndexChanged;

            baseSample1.pControls.Controls.Add(cbChartType);
            baseSample1.pControls.Controls.Add(cbSelectionMode);
            #endregion
            foreach (var chartType in new ChartType[] { ChartType.Column, ChartType.Bar, ChartType.Scatter, ChartType.Line,
                                                        ChartType.LineSymbols, ChartType.Area, ChartType.Spline, ChartType.SplineArea, ChartType.SplineSymbols, ChartType.Step, ChartType.StepArea, ChartType.StepSymbols })
            {
                cbChartType.Items.Add(new ComboBoxItem("Chart type")
                {
                    Text = ((C1.Chart.ChartType)chartType).ToString(), Value = (int)chartType
                });
            }
            cbChartType.SelectedIndex = 0;

            foreach (var item in Enum.GetValues(typeof(C1.Chart.ChartSelectionMode)))
            {
                cbSelectionMode.Items.Add(new ComboBoxItem("Selection mode")
                {
                    Text = ((C1.Chart.ChartSelectionMode)item).ToString(), Value = (int)item
                });
            }
            cbSelectionMode.SelectedIndex = 1;
        }
 private void InitializeControls()
 {
     //Set localized content
     baseSample1.lblTitle.Text     = Localizer.GetItem("advanced", "title");
     baseSample1.tbDescription.Rtf = Localizer.GetItem("advanced", "description").MakeRtf();
     baseSample1.pScroll.Controls.Remove(baseSample1.pControls);
     flexChart1            = baseSample1.flexChart1;
     flexChart1.Rendered  += flexChart1_Rendered;
     flexChart1.MouseMove += flexChart1_MouseMove;
 }
        private void InitializeControls()
        {
            #region Init controls

            //Set localized text
            baseSample1.lblTitle.Text     = Localizer.GetItem("custompaint", "title");
            baseSample1.tbDescription.Rtf = Localizer.GetItem("custompaint", "description").MakeRtf();

            baseSample1.pControls.Visible = false;
            #endregion
        }
        private void InitializeControls()
        {
            // Set localized text
            baseSample1.lblTitle.Text       = Localizer.GetItem("tooltips", "title");
            baseSample1.pDescription.Height = 180;
            baseSample1.tbDescription.Rtf   = Localizer.GetItem("tooltips", "description").MakeRtf();

            baseSample1.tbCode.Text = @"// Set tooltip
flexChart1.ToolTip.Content = ""{seriesName}\r\n{x}-{y}"";";

            flexChart1 = baseSample1.flexChart1;
            baseSample1.pControls.Visible = false;
        }
        private void InitializeControls()
        {
            #region Init controls

            //Set localized text
            baseSample1.lblTitle.Text       = Localizer.GetItem("toggle", "title");
            baseSample1.pDescription.Height = 200;
            baseSample1.tbDescription.Rtf   = Localizer.GetItem("toggle", "description").MakeRtf();

            baseSample1.tbCode.Text = @"//FlexChart LegendToggle property
flexChart1.LegendToggle = true;

//OR you can change visibility manually
serie.Visibility = C1.Chart.SeriesVisibility.Legend;";

            flexChart1 = baseSample1.flexChart1;

            chbMarch = new CheckBox()
            {
                Text      = "March",
                Location  = new Point(40, 5),
                FlatStyle = FlatStyle.Flat,
                Checked   = true
            };
            chbMarch.CheckedChanged += chb_CheckedChanged;

            chbApril = new CheckBox()
            {
                Text      = "April",
                Location  = new Point(chbMarch.Right + 10, 5),
                FlatStyle = FlatStyle.Flat,
                Checked   = true
            };
            chbApril.CheckedChanged += chb_CheckedChanged;

            chbMay = new CheckBox()
            {
                Text      = "May",
                Location  = new Point(chbApril.Right, 5),
                FlatStyle = FlatStyle.Flat,
                Checked   = true
            };
            chbMay.CheckedChanged += chb_CheckedChanged;

            baseSample1.pControls.Controls.Add(chbMarch);
            baseSample1.pControls.Controls.Add(chbApril);
            baseSample1.pControls.Controls.Add(chbMay);
            #endregion
        }
        private void InitializeControls()
        {
            //Set localized content
            baseSample1.lblTitle.Text     = Localizer.GetItem("legenditems", "title");
            baseSample1.tbDescription.Rtf = Localizer.GetItem("legenditems", "description").MakeRtf();
            flexChart1       = baseSample1.flexChart1;
            chbPointsLegends = new CheckBox()
            {
                Text      = "Display Series Points in Legend",
                FlatStyle = FlatStyle.Flat,
                Checked   = true,
                AutoSize  = true
            };
            chbPointsLegends.CheckedChanged += ChbPointsLegends_CheckedChanged;
            baseSample1.pControls.Controls.Add(chbPointsLegends);

            chbLegendGroups = new CheckBox()
            {
                Text      = "Display Legend Groups",
                FlatStyle = FlatStyle.Flat,
                Checked   = true,
                AutoSize  = true
            };
            chbLegendGroups.CheckedChanged += ChbLegendGroups_CheckedChanged;
            baseSample1.pControls.Controls.Add(chbLegendGroups);

            chbLegendCustomIcons = new CheckBox()
            {
                Text      = "Display Custom Icons",
                FlatStyle = FlatStyle.Flat,
                Checked   = true,
                AutoSize  = true
            };
            chbLegendCustomIcons.CheckedChanged += chbLegendCustomIcons_CheckedChanged;
            baseSample1.pControls.Controls.Add(chbLegendCustomIcons);

            chbLegendNames = new CheckBox()
            {
                Text      = "Display Legend Names",
                FlatStyle = FlatStyle.Flat,
                Checked   = true,
                AutoSize  = true
            };
            chbLegendNames.CheckedChanged += chbLegendNames_CheckedChanged;
            baseSample1.pControls.Controls.Add(chbLegendNames);
        }
Ejemplo n.º 10
0
        private void InitializeControls()
        {
            //Set localized text
            baseSample1.lblTitle.Text       = Localizer.GetItem("customizingaxes", "title");
            baseSample1.pDescription.Height = 120;
            baseSample1.tbDescription.Rtf   = Localizer.GetItem("customizingaxes", "description").MakeRtf();

            baseSample1.tbCode.Text = @"// Set axis properties
flexChart1.AxisY.AxisLine = true;
flexChart1.AxisY.Labels = false;
flexChart1.AxisY.MajorGrid = false;
flexChart1.AxisY.MajorTickMarks = C1.Chart.TickMark.Outside;
flexChart1.AxisY.Min = 0;
flexChart1.AxisY.Max = 10;";

            flexChart1 = baseSample1.flexChart1;
            baseSample1.pControls.Visible = false;
        }
        private void InitializeControls()
        {
            #region Init controls

            //Set localized text
            baseSample1.lblTitle.Text       = Localizer.GetItem("dynamic", "title");
            baseSample1.pDescription.Height = 140;
            baseSample1.tbDescription.Rtf   = Localizer.GetItem("dynamic", "description").MakeRtf();

            baseSample1.tbCode.Text = @"//use ObservableCollection for dynamics charts
flexChart1.DataSource = new ObservableCollection<DataItem>();";

            flexChart1 = baseSample1.flexChart1;

            btnSlow = new Button()
            {
                Left = 40, Width = 80, Text = "Slow", FlatStyle = FlatStyle.Flat, ForeColor = Color.DimGray
            };
            btnSlow.Click += btnSlow_Click;

            btnMedium = new Button()
            {
                Left = btnSlow.Right + 10, Width = 80, Text = "Medium", FlatStyle = FlatStyle.Flat, ForeColor = Color.DimGray
            };
            btnMedium.Click += btnMedium_Click;

            btnFast = new Button()
            {
                Left = btnMedium.Right + 10, Width = 80, Text = "Fast", FlatStyle = FlatStyle.Flat, ForeColor = Color.DimGray
            };
            btnFast.Click += btnFast_Click;

            btnStop = new Button()
            {
                Left = btnFast.Right + 10, Width = 80, Text = "Stop", FlatStyle = FlatStyle.Flat, ForeColor = Color.DimGray
            };
            btnStop.Click += btnStop_Click;

            baseSample1.pControls.Controls.Add(btnSlow);
            baseSample1.pControls.Controls.Add(btnMedium);
            baseSample1.pControls.Controls.Add(btnFast);
            baseSample1.pControls.Controls.Add(btnStop);
            #endregion
        }
        private void InitializeControls()
        {
            #region Init controls

            // Set localized text
            baseSample1.lblTitle.Text       = Localizer.GetItem("stylingseries", "title");
            baseSample1.pDescription.Height = 100;
            baseSample1.tbDescription.Rtf   = Localizer.GetItem("stylingseries", "description").MakeRtf();

            baseSample1.tbCode.Text = @"// Set FlexChart.Palette property
flexChart1.Palette = C1.Chart.Palette.Dark;

// OR you can set up style manually
var s1 = new Series();
s1.Style.Fill = new SolidBrush(Color.Yellow);
s1.Style.Stroke = new SolidBrush(Color.Blue);
s1.Style.StrokeWidth = 1;";

            flexChart1 = baseSample1.flexChart1;

            // Initialize Palette combo box
            cbPalette = new ComboBox()
            {
                Width         = 150,
                Dock          = DockStyle.Top,
                FlatStyle     = FlatStyle.Flat,
                ForeColor     = Color.DimGray,
                DropDownStyle = ComboBoxStyle.DropDownList
            };
            cbPalette.SelectedIndexChanged += cbPalette_SelectedIndexChanged;

            baseSample1.pControls.Controls.Add(cbPalette);
            #endregion
            foreach (var item in Enum.GetValues(typeof(C1.Chart.Palette)))
            {
                cbPalette.Items.Add(new ComboBoxItem("Palette ")
                {
                    Text = ((C1.Chart.Palette)item).ToString(), Value = (int)item
                });
            }
            cbPalette.SelectedIndex = 0;
        }
        private void InitializeControls()
        {
            //Set localized content
            baseSample1.lblTitle.Text     = Localizer.GetItem("asyncDrillDown", "title");
            baseSample1.tbDescription.Rtf = Localizer.GetItem("asyncDrillDown", "description").MakeRtf();

            flexChart1 = baseSample1.flexChart1;

            pnlNavBar = new FlowLayoutPanel()
            {
                FlowDirection = FlowDirection.LeftToRight,
                WrapContents  = false,
                AutoSize      = true,
                Font          = new Font(this.Font.FontFamily, 11),
                Padding       = new Padding(5)
            };

            baseSample1.pControls.WrapContents = true;
            baseSample1.pControls.AutoSize     = true;
            baseSample1.pControls.Controls.Add(pnlNavBar);
        }
        private void InitializeControls()
        {
            #region Init controls

            // Set localized text
            baseSample1.lblTitle.Text       = Localizer.GetItem("funnel", "title");
            baseSample1.pDescription.Height = 80;
            baseSample1.tbDescription.Rtf   = Localizer.GetItem("funnel", "description").MakeRtf();

            baseSample1.tbCode.Text = @"// Set FunnelNeckWidth properties
flexChart1.Options.FunnelNeckWidth = 0.2;
// Set FunnelNeckHeight property
flexChart1.Options.FunnelNeckHeight = 0.2;
// Set FunnelType property
flexChart1.Options.FunnelType = FunnelChartType.Default;
";

            flexChart1           = baseSample1.flexChart1;
            flexChart1.ChartType = ChartType.Funnel;


            // Initialize FunnelNeckWidth
            nudNeckWidth = new NumericUpDown()
            {
                Size          = new Size(150, 21),
                ForeColor     = Color.DimGray,
                Minimum       = 0,
                Maximum       = 1,
                DecimalPlaces = 1,
                Increment     = 0.1m,
                Value         = 0.2m
            };
            nudNeckWidth.ValueChanged += nudNeckWidth_ValueChanged;

            // Initialize FunnelNeckHeight
            nudNeckHeight = new NumericUpDown()
            {
                Size          = new Size(150, 21),
                ForeColor     = Color.DimGray,
                Minimum       = 0,
                Maximum       = 1,
                DecimalPlaces = 1,
                Increment     = 0.1m,
                Value         = 0.2m
            };
            nudNeckHeight.ValueChanged += nudNeckHeight_ValueChanged;

            // Initialize FunnelType combo box
            cbFunnelType = new ComboBox()
            {
                Size          = new Size(150, 21),
                FlatStyle     = FlatStyle.Flat,
                ForeColor     = Color.DimGray,
                DropDownStyle = ComboBoxStyle.DropDownList
            };
            cbFunnelType.SelectedIndexChanged += cbFunnelType_SelectedIndexChanged;

            baseSample1.pControls.Controls.Add(new Label()
            {
                Text = "Neck Width:", Width = 80, Height = 21, TextAlign = ContentAlignment.BottomLeft
            });
            baseSample1.pControls.Controls.Add(nudNeckWidth);
            baseSample1.pControls.Controls.Add(new Label()
            {
                Text = "Neck Height:", Width = 80, Height = 21, TextAlign = ContentAlignment.BottomLeft
            });
            baseSample1.pControls.Controls.Add(nudNeckHeight);
            baseSample1.pControls.Controls.Add(cbFunnelType);
            #endregion

            foreach (var item in Enum.GetValues(typeof(C1.Chart.FunnelChartType)))
            {
                cbFunnelType.Items.Add(new ComboBoxItem("FunnelType")
                {
                    Text = ((C1.Chart.FunnelChartType)item).ToString(), Value = (int)item
                });
            }
            cbFunnelType.SelectedIndex = 0;
        }
        private void InitializeControls()
        {
            #region Init controls

            // Set localized text
            baseSample1.lblTitle.Text       = Localizer.GetItem("charttypes", "title");
            baseSample1.pDescription.Height = 130;
            baseSample1.tbDescription.Rtf   = Localizer.GetItem("charttypes", "description").MakeRtf();

            baseSample1.tbCode.Text = @"// Set FlexChart.ChartType property
flexChart1.ChartType = C1.Chart.ChartType.Bar;

// Set FlexChart.Stacked property
flexChart1.Stacking = C1.Chart.Stacking.Stacked;

// Set FlexChart.Rotated property
flexChart1.Rotated = true;
";

            flexChart1 = baseSample1.flexChart1;

            // Initialize ChartType combo box
            cbChartType = new ComboBox()
            {
                Location      = new Point(40, 5),
                Size          = new Size(150, 21),
                FlatStyle     = FlatStyle.Flat,
                ForeColor     = Color.DimGray,
                DropDownStyle = ComboBoxStyle.DropDownList
            };
            cbChartType.SelectedIndexChanged += cbChartType_SelectedIndexChanged;

            // Initialize Stacked combo box
            cbStacked = new ComboBox()
            {
                Location      = new Point(cbChartType.Right + 10, 5),
                Size          = new Size(150, 21),
                FlatStyle     = FlatStyle.Flat,
                ForeColor     = Color.DimGray,
                DropDownStyle = ComboBoxStyle.DropDownList
            };
            cbStacked.SelectedIndexChanged += cbStacked_SelectedIndexChanged;

            // Initialize Rotate checkbox
            chbRotate = new CheckBox()
            {
                Text      = "Rotate",
                Location  = new Point(cbStacked.Right + 10, 5),
                FlatStyle = FlatStyle.Flat,
                Checked   = false
            };
            chbRotate.CheckedChanged += cbRotated_CheckedChanged;

            baseSample1.pControls.Controls.Add(cbChartType);
            baseSample1.pControls.Controls.Add(cbStacked);
            baseSample1.pControls.Controls.Add(chbRotate);
            #endregion

            foreach (var chartType in new ChartType[] { ChartType.Column, ChartType.Bar, ChartType.Scatter, ChartType.Line,
                                                        ChartType.LineSymbols, ChartType.Area, ChartType.Spline, ChartType.SplineArea, ChartType.SplineSymbols, ChartType.Step, ChartType.StepArea, ChartType.StepSymbols })
            {
                cbChartType.Items.Add(new ComboBoxItem("Chart type")
                {
                    Text = ((C1.Chart.ChartType)chartType).ToString(), Value = (int)chartType
                });
            }
            cbChartType.SelectedIndex = 0;

            foreach (var item in Enum.GetValues(typeof(C1.Chart.Stacking)))
            {
                cbStacked.Items.Add(new ComboBoxItem("Stacking")
                {
                    Text = ((C1.Chart.Stacking)item).ToString(), Value = (int)item
                });
            }
            cbStacked.SelectedIndex = 0;
        }
Ejemplo n.º 16
0
        private void InitializeControls()
        {
            #region Init controls

            //Set localized text
            baseSample1.lblTitle.Text     = Localizer.GetItem("introduction", "title");
            baseSample1.tbDescription.Rtf = Localizer.GetItem("introduction", "description").MakeRtf();

            //Init ChartType combobox
            cbLines = new ComboBox()
            {
                Size      = new Size(200, 21),
                FlatStyle = FlatStyle.Flat,
                ForeColor = Color.DimGray
            };
            cbLines.SelectedIndexChanged += cbLines_SelectedIndexChanged;

            //Init Palette combobox
            cbInteraction = new ComboBox()
            {
                Size      = new Size(200, 21),
                FlatStyle = FlatStyle.Flat,
                ForeColor = Color.DimGray
            };
            cbInteraction.SelectedIndexChanged += cbInteraction_SelectedIndexChanged;

            //Init Stacked combobox
            cbAlignment = new ComboBox()
            {
                Size      = new Size(200, 21),
                FlatStyle = FlatStyle.Flat,
                ForeColor = Color.DimGray
            };
            cbAlignment.SelectedIndexChanged += cbAlignment_SelectedIndexChanged1;

            baseSample1.pControls.Controls.Add(cbLines);
            baseSample1.pControls.Controls.Add(cbInteraction);
            baseSample1.pControls.Controls.Add(cbAlignment);
            #endregion

            foreach (var item in Enum.GetValues(typeof(LineMarkerLines)))
            {
                cbLines.Items.Add(new ComboBoxItem("Lines")
                {
                    Text = ((LineMarkerLines)item).ToString(), Value = (int)item
                });
            }

            foreach (var item in Enum.GetValues(typeof(LineMarkerInteraction)))
            {
                cbInteraction.Items.Add(new ComboBoxItem("Interaction")
                {
                    Text = ((LineMarkerInteraction)item).ToString(), Value = (int)item
                });
            }

            foreach (var item in Enum.GetValues(typeof(LineMarkerAlignment)))
            {
                cbAlignment.Items.Add(new ComboBoxItem("Alignment")
                {
                    Text = ((LineMarkerAlignment)item).ToString(), Value = (int)item
                });
            }
        }
Ejemplo n.º 17
0
        private void InitializeControls()
        {
            //Set localized text
            baseSample1.lblTitle.Text       = Localizer.GetItem("legendandtitles", "title");
            baseSample1.pDescription.Height = 90;
            baseSample1.tbDescription.Rtf   = Localizer.GetItem("legendandtitles", "description").MakeRtf();

            baseSample1.tbCode.Text = @"// Add header, footer and legend options
flexChart1.Header.Content = ""Sample Chart"";
flexChart1.Footer.Content = ""copyright (c) ComponentOne"";
flexChart1.AxisX.Title = ""Country"";
flexChart1.AxisY.Title = ""Amount"";
flexChart1.Legend.Position = Position.Right;
foreach (Series ser in flexChart1.Series)
   ser.LegendGroup = (ser.Name.IndexOf(""Sales"") > -1) ? ""Sales"" : ""Expenses"";";

            flexChart1 = baseSample1.flexChart1;

            Label lblHeader = new Label()
            {
                Text      = "Header: ",
                ForeColor = Color.DimGray,
                TextAlign = ContentAlignment.MiddleRight,
                Width     = 70
            };

            TextBox tbHeader = new TextBox()
            {
                Text        = "Sample Chart",
                BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D,
                ForeColor   = Color.DimGray,
                Width       = 100
            };

            tbHeader.TextChanged += tbHeader_TextChanged;

            Label lblFooter = new Label()
            {
                Text      = "Footer: ",
                ForeColor = Color.DimGray,
                TextAlign = ContentAlignment.MiddleRight,
                Width     = 70
            };

            TextBox tbFooter = new TextBox()
            {
                Text        = "copyright © GrapeCity, inc.",
                BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D,
                ForeColor   = Color.DimGray,
                Width       = 150,
            };

            tbFooter.TextChanged += tbFooter_TextChanged;

            Label lblAxisXTitle = new Label()
            {
                Text      = "AxisX title: ",
                ForeColor = Color.DimGray,
                TextAlign = ContentAlignment.MiddleRight,
                Width     = 70
            };
            TextBox tbAxisXTitle = new TextBox()
            {
                Text        = "Country",
                BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D,
                ForeColor   = Color.DimGray,
                Width       = 100
            };

            tbAxisXTitle.TextChanged += tbAxisXTitle_TextChanged;

            Label lblAxisYTitle = new Label()
            {
                Text      = "AxisY title: ",
                ForeColor = Color.DimGray,
                TextAlign = ContentAlignment.MiddleRight,
                Width     = 70
            };
            TextBox tbAxisYTitle = new TextBox()
            {
                Text        = "Amount",
                BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D,
                ForeColor   = Color.DimGray,
                Width       = 100
            };

            tbAxisYTitle.TextChanged += tbAxisYTitle_TextChanged;

            Label lblLegend = new Label()
            {
                Text      = "Legend: ",
                ForeColor = Color.DimGray,
                TextAlign = ContentAlignment.MiddleRight,
                Margin    = new Padding(50, 0, 0, 0),
                Width     = 70
            };
            ComboBox cbLegend = new ComboBox()
            {
                FlatStyle     = FlatStyle.Flat,
                ForeColor     = Color.DimGray,
                DropDownStyle = ComboBoxStyle.DropDownList,
                Width         = 100
            };

            foreach (var item in Enum.GetValues(typeof(C1.Chart.Position)))
            {
                cbLegend.Items.Add(new ComboBoxItem("Legend")
                {
                    Text = ((C1.Chart.Position)item).ToString(), Value = (int)item
                });
            }
            cbLegend.SelectedIndexChanged += cbLegend_SelectedIndexChanged;
            cbLegend.SelectedIndex         = 1;

            CheckBox cbReversed = new CheckBox()
            {
                FlatStyle = FlatStyle.Flat,
                ForeColor = Color.DimGray,
                Text      = "Reversed",
                Checked   = false
            };
            CheckBox cbGrouped = new CheckBox()
            {
                FlatStyle = FlatStyle.Flat,
                ForeColor = Color.DimGray,
                Text      = "Grouped",
                Checked   = true
            };

            cbReversed.CheckedChanged += cbReversed_CheckedChanged;
            cbGrouped.CheckedChanged  += cbGrouped_CheckedChanged;

            baseSample1.pControls.SetFlowBreak(cbGrouped, true);
            baseSample1.pControls.SetFlowBreak(cbLegend, true);
            baseSample1.pControls.SetFlowBreak(tbAxisYTitle, true);
            baseSample1.pControls.SetFlowBreak(tbAxisXTitle, true);
            baseSample1.pControls.SetFlowBreak(tbFooter, true);
            baseSample1.pControls.SetFlowBreak(tbHeader, true);

            baseSample1.pControls.Controls.Add(lblHeader);
            baseSample1.pControls.Controls.Add(tbHeader);
            baseSample1.pControls.Controls.Add(lblFooter);
            baseSample1.pControls.Controls.Add(tbFooter);
            baseSample1.pControls.Controls.Add(lblAxisXTitle);
            baseSample1.pControls.Controls.Add(tbAxisXTitle);
            baseSample1.pControls.Controls.Add(lblAxisYTitle);
            baseSample1.pControls.Controls.Add(tbAxisYTitle);
            baseSample1.pControls.Controls.Add(lblLegend);
            baseSample1.pControls.Controls.Add(cbLegend);
            baseSample1.pControls.Controls.Add(cbReversed);
            baseSample1.pControls.Controls.Add(cbGrouped);
        }
Ejemplo n.º 18
0
        private void InitializeControls()
        {
            //Set localized content
            baseSample1.lblTitle.Text     = Localizer.GetItem("basicDrillDown", "title");
            baseSample1.tbDescription.Rtf = Localizer.GetItem("basicDrillDown", "description").MakeRtf();

            cbChartType = new ComboBox()
            {
                Size      = new Size(200, 21),
                FlatStyle = FlatStyle.Flat,
                ForeColor = Color.DimGray
            };
            cbAggregateType = new ComboBox()
            {
                Size      = new Size(200, 21),
                FlatStyle = FlatStyle.Flat,
                ForeColor = Color.DimGray
            };
            cbGroupBy = new ComboBox()
            {
                Size      = new Size(200, 21),
                FlatStyle = FlatStyle.Flat,
                ForeColor = Color.DimGray
            };
            flexChart1 = baseSample1.flexChart1;

            flexPie1 = new FlexPie()
            {
                Dock      = DockStyle.Fill,
                Visible   = true,
                BackColor = Color.White,
            };

            chkEnableDrill = new CheckBox
            {
                Text     = "Enable DrillDown",
                Checked  = isDrillDownEnabled,
                AutoSize = true
            };

            pnlNavBar = new FlowLayoutPanel()
            {
                FlowDirection = FlowDirection.LeftToRight,
                WrapContents  = false,
                AutoSize      = true,
                Font          = new Font(this.Font.FontFamily, 11),
                Padding       = new Padding(5)
            };

            chkEnableDrill.CheckedChanged += (o, e) =>
            {
                isDrillDownEnabled = chkEnableDrill.Checked;
            };

            foreach (var item in Enum.GetValues(typeof(AggregateType)))
            {
                cbAggregateType.Items.Add(new ComboBoxItem("Aggregate Type")
                {
                    Text = ((AggregateType)item).ToString(), Value = (int)item
                });
            }
            cbAggregateType.SelectedIndex = 0;

            cbAggregateType.SelectedIndexChanged += (o, e) =>
            {
                manager.AggregateType = (AggregateType)Enum.Parse(typeof(AggregateType), (cbAggregateType.SelectedItem as ComboBoxItem).Text);
                UpdateChart();
            };

            cbChartType.Items.Add(new ComboBoxItem("Chart Type")
            {
                Text = "Column"
            });
            cbChartType.Items.Add(new ComboBoxItem("Chart Type")
            {
                Text = "LineSymbols"
            });
            cbChartType.Items.Add(new ComboBoxItem("Chart Type")
            {
                Text = "Pie"
            });
            cbChartType.SelectedIndex         = 0;
            cbChartType.SelectedIndexChanged += (o, e) =>
            {
                var selectedText = (cbChartType.SelectedItem as ComboBoxItem).Text;
                if (selectedText == "Pie")
                {
                    isFlexChartShown = false;
                    baseSample1.pChart.Controls.Clear();
                    baseSample1.pChart.Controls.Add(flexPie1);
                }
                else
                {
                    flexChart1.ChartType = (ChartType)Enum.Parse(typeof(ChartType), selectedText);
                    isFlexChartShown     = true;
                    baseSample1.pChart.Controls.Clear();
                    baseSample1.pChart.Controls.Add(flexChart1);
                }
                UpdateChart();
            };

            cbGroupBy.Items.Add(new ComboBoxItem("Group By")
            {
                Text = "Country,City", Value = 0
            });
            cbGroupBy.Items.Add(new ComboBoxItem("Group By")
            {
                Text = "Country,Year", Value = 1
            });
            cbGroupBy.Items.Add(new ComboBoxItem("Group By")
            {
                Text = "Year,Country", Value = 2
            });
            cbGroupBy.Items.Add(new ComboBoxItem("Group By")
            {
                Text = "Country,City,Year", Value = 3
            });
            cbGroupBy.Items.Add(new ComboBoxItem("Group By")
            {
                Text = "Year,Country,City", Value = 4
            });
            cbGroupBy.SelectedIndex         = 2;
            cbGroupBy.SelectedIndexChanged += (o, e) =>
            {
                Queue <string> drilldownPath = new Queue <string>();
                var            selectedText  = (cbGroupBy.SelectedItem as ComboBoxItem).Text;
                var            groups        = selectedText.Split(',');
                foreach (var group in groups)
                {
                    drilldownPath.Enqueue(group.Trim());
                }
                manager.DrillDownPath = selectedText;
                UpdateChart();
            };
            baseSample1.pControls.WrapContents = true;
            baseSample1.pControls.AutoSize     = true;
            baseSample1.pControls.Controls.Add(cbGroupBy);
            baseSample1.pControls.Controls.Add(cbAggregateType);
            baseSample1.pControls.Controls.Add(cbChartType);
            baseSample1.pControls.Controls.Add(chkEnableDrill);
            baseSample1.pControls.Controls.Add(pnlNavBar);
            baseSample1.pControls.SetFlowBreak(chkEnableDrill, true);
        }
 private void InitializeControls()
 {
     //Set localized content
     baseSample1.lblTitle.Text     = Localizer.GetItem("sunburst", "title");
     baseSample1.tbDescription.Rtf = Localizer.GetItem("sunburst", "description").MakeRtf();
 }