Esempio n. 1
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            if (Area.Checked)
            {
                // Set chart type to Area
                Chart1.Series["Series1"].ChartType = SeriesChartType.Area;
                Chart1.Series["Series2"].ChartType = SeriesChartType.Area;
                LineTensionList.Enabled            = false;
            }
            else if (SplineArea.Checked)
            {
                // Set chart type to SplineArea and set line tension
                LineTensionList.Enabled                 = true;
                Chart1.Series["Series1"].ChartType      = SeriesChartType.SplineArea;
                Chart1.Series["Series1"]["LineTension"] = LineTensionList.SelectedItem.Text;
                Chart1.Series["Series2"].ChartType      = SeriesChartType.SplineArea;
                Chart1.Series["Series2"]["LineTension"] = LineTensionList.SelectedItem.Text;
            }

            // Set Show of marker Lines
            Chart1.Series["Series1"]["ShowMarkerLines"] = ShowMarkers.Checked.ToString();
            Chart1.Series["Series2"]["ShowMarkerLines"] = ShowMarkers.Checked.ToString();


            // Disable/enable X axis margin
            Chart1.ChartAreas["ChartArea1"].AxisX.IsMarginVisible = ShowMargins.Checked;

            // set the lighting choice
            if (LightingType.SelectedItem.Text != "")
            {
                Chart1.ChartAreas["ChartArea1"].Area3DStyle.LightStyle = (LightStyle)LightStyle.Parse(typeof(LightStyle), LightingType.SelectedItem.Text);
            }
        }
Esempio n. 2
0
        private void UpdateChartSettings()
        {
            if (radioButtonArea.Checked)
            {
                // Set chart type to Area
                chart1.Series["Series1"].ChartType = SeriesChartType.Area;
                chart1.Series["Series2"].ChartType = SeriesChartType.Area;
                chart1.Series["Series1"].DeleteCustomProperty("LineTension");
                chart1.Series["Series2"].DeleteCustomProperty("LineTension");
                comboBoxTension.Enabled = false;
            }
            else
            {
                // Set chart type to SplineArea and set line tension
                comboBoxTension.Enabled                 = true;
                chart1.Series["Series1"].ChartType      = SeriesChartType.SplineArea;
                chart1.Series["Series1"]["LineTension"] = comboBoxTension.Text;
                chart1.Series["Series2"].ChartType      = SeriesChartType.SplineArea;
                chart1.Series["Series2"]["LineTension"] = comboBoxTension.Text;
            }

            // Disable/enable X axis margin
            chart1.ChartAreas["Default"].AxisX.IsMarginVisible = checkBoxShowMargin.Checked;
            chart1.Series["Series1"]["ShowMarkerLines"]        = ShowMarkerLines.Checked.ToString();
            chart1.Series["Series2"]["ShowMarkerLines"]        = ShowMarkerLines.Checked.ToString();

            // Set area lighting
            if (LightingType.Text != "")
            {
                chart1.ChartAreas["Default"].Area3DStyle.LightStyle = (LightStyle)LightStyle.Parse(typeof(LightStyle), LightingType.Text);
            }
        }
        private void UpdateChartSettings()
        {
            if (comboBoxChartType.Text == "")
            {
                return;
            }

            // Loop through all series
            foreach (Series series in chart1.Series)
            {
                // Set marker lines
                series["ShowMarkerLines"] = ShowMarkerLines.Checked.ToString();

                // Set chart type and line tension
                if (comboBoxChartType.Text == "Spline Range")
                {
                    series.ChartType            = SeriesChartType.SplineRange;
                    comboBoxLineTension.Enabled = true;
                    series["LineTension"]       = comboBoxLineTension.Text;
                }
                else
                {
                    series.ChartType            = SeriesChartType.Range;
                    comboBoxLineTension.Enabled = false;
                    series.DeleteCustomProperty("LineTension");
                }
            }

            // Disable/enable X axis margin
            chart1.ChartAreas["Default"].AxisX.IsMarginVisible = checkBoxShowMargin.Checked;

            // Set area lighting
            if (LightingType.Text != "")
            {
                chart1.ChartAreas["Default"].Area3DStyle.LightStyle = (LightStyle)LightStyle.Parse(typeof(LightStyle), LightingType.Text);
            }

            if (UsePerspective.Checked)
            {
                chart1.ChartAreas["Default"].Area3DStyle.Perspective = 10;
                chart1.ChartAreas["Default"].Area3DStyle.PointDepth  = 200;
            }
            else
            {
                chart1.ChartAreas["Default"].Area3DStyle.Perspective = 0;
                chart1.ChartAreas["Default"].Area3DStyle.PointDepth  = 100;
            }
        }