protected void Page_Load(object sender, System.EventArgs e)
        {
            if (!this.IsPostBack)
            {
                foreach (string breakTypes in Enum.GetNames(typeof(BreakLineStyle)))
                {
                    this.BreakType.Items.Add(breakTypes);
                }

                this.BreakType.SelectedIndex       = 3;
                this.ScaleBreakColor.SelectedIndex = 0;
            }

            if (this.chk_Enable.Checked)
            {
                this.Chart1.ChartAreas["ChartArea1"].AxisY.ScaleBreakStyle.Enabled = true;
                this.BreakType.Enabled       = true;
                this.Spacing.Enabled         = true;
                this.ScaleBreakColor.Enabled = true;
            }

            else
            {
                this.Chart1.ChartAreas["ChartArea1"].AxisY.ScaleBreakStyle.Enabled = false;
                this.BreakType.Enabled       = false;
                this.Spacing.Enabled         = false;
                this.ScaleBreakColor.Enabled = false;
            }

            // Set the scale break type
            Chart1.ChartAreas["ChartArea1"].AxisY.ScaleBreakStyle.BreakLineStyle = (BreakLineStyle)BreakLineStyle.Parse(typeof(BreakLineStyle), this.BreakType.SelectedItem.ToString());

            // Set the spacing
            Chart1.ChartAreas["ChartArea1"].AxisY.ScaleBreakStyle.Spacing = double.Parse(this.Spacing.SelectedItem.ToString());

            // Set the line color
            Chart1.ChartAreas["ChartArea1"].AxisY.ScaleBreakStyle.LineColor = Color.FromName(this.ScaleBreakColor.SelectedItem.ToString());
        }
Beispiel #2
0
 private void cb_BreakLineStyle_SelectedIndexChanged(object sender, System.EventArgs e)
 {
     // Set the scale break type
     Chart1.ChartAreas[0].AxisY.ScaleBreakStyle.BreakLineStyle = (BreakLineStyle)BreakLineStyle.Parse(typeof(BreakLineStyle), this.cb_BreakLineStyle.SelectedItem.ToString());
 }