Пример #1
0
        private void EasyChartProperty_Load(object sender, EventArgs e)
        {
            //update groupbox of Size
            numericUpDown_Height.Value = _changedCtrl.Size.Height;
            numericUpDown_Width.Value  = _changedCtrl.Size.Width;
            //update groupbox of LegendVisible
            checkBox_LegendVisible.Checked = _changedCtrl.LegendVisible;
            //update Tickwidth
            checkBox_AutoYaxis.Checked = _changedCtrl.YAutoEnable;
            if (_changedCtrl.YAutoEnable == true)
            {
                numericUpDown_YaxisMax.Enabled = false;
                numericUpDown_YaxisMin.Enabled = false;
            }
            else
            {
                numericUpDown_YaxisMax.Enabled = true;
                numericUpDown_YaxisMin.Enabled = true;
            }
            if (!_changedCtrl.YAutoEnable)
            {
                double[] yAxisRange = new double[2];
                yAxisRange = _changedCtrl.GetYAxisRange();
                numericUpDown_YaxisMax.Value = (decimal)yAxisRange[0];
                numericUpDown_YaxisMin.Value = (decimal)yAxisRange[1];
            }
            //update Colors
            button_BackColor.BackColor          = _changedCtrl.EasyChartBackColor;
            button_ChartAreaBackColor.BackColor = _changedCtrl.ChartAreaBackColor;
            button_ChartAreaBackColor.BackColor = _changedCtrl.LegendBackColor;
            //调用驱动中AITerminal的枚举作为选单
            comboBox_GradientStyle.Items.AddRange(Enum.GetNames(typeof(System.Windows.Forms.DataVisualization.Charting.GradientStyle)));
            if (_changedCtrl.ChartAreaBackColor == Color.Transparent)
            {
                checkBox_AreaTransparent.Checked = true;
            }
            else
            {
                checkBox_AreaTransparent.Checked = false;
            }

            if (_changedCtrl.LegendBackColor == Color.Transparent)
            {
                checkBox_LegendTransparent.Checked = true;
            }
            else
            {
                checkBox_LegendTransparent.Checked = false;
            }

            comboBox_GradientStyle.SelectedText = _changedCtrl.GradientStyle.ToString();
            //update X&Y Logarithmic
            checkBox_XAxisLogarithmic.Checked = _changedCtrl.XAxisLogarithmic;
            checkBox_YAxisLogarithmic.Checked = _changedCtrl.YAxisLogarithmic;
        }
Пример #2
0
        private void CancelConfigure()
        {
            EasyChart beforeEasyChart = ((EasyChart)_beforeCtrl);

            _changedCtrl.Size = beforeEasyChart.Size;

            _changedCtrl.LegendVisible = beforeEasyChart.LegendVisible;
            _changedCtrl.YAutoEnable   = beforeEasyChart.YAutoEnable;
            double[] yAxisRange = new double[2];
            yAxisRange = beforeEasyChart.GetYAxisRange();
            if (!double.IsNaN(yAxisRange[0]))
            {
                _changedCtrl.AxisYMax = (int)yAxisRange[0];
            }
            if (!double.IsNaN(yAxisRange[1]))
            {
                _changedCtrl.AxisYMin = (int)yAxisRange[1];
            }

            _changedCtrl.EasyChartBackColor = beforeEasyChart.EasyChartBackColor;
            _changedCtrl.ChartAreaBackColor = beforeEasyChart.ChartAreaBackColor;
            _changedCtrl.LegendBackColor    = beforeEasyChart.LegendBackColor;
            _changedCtrl.GradientStyle      = beforeEasyChart.GradientStyle;
            _changedCtrl.XAxisLogarithmic   = beforeEasyChart.XAxisLogarithmic;
            _changedCtrl.YAxisLogarithmic   = beforeEasyChart.YAxisLogarithmic;
        }
Пример #3
0
 public Set_YAxis_Range(EasyChart easyChartObj)
 {
     InitializeComponent();
     easyChartForm  = easyChartObj;
     YAutoScaleFlag = easyChartForm.YAutoEnable;
     if (YAutoScaleFlag)
     {
         easyChartForm.YAutoEnable = false;
     }
     double[] yAxisRange = new double[2];
     yAxisRange = easyChartForm.GetYAxisRange();
     numericUpDownYMax.Value = (decimal)yAxisRange[0];
     numericUpDownYMin.Value = (decimal)yAxisRange[1];
 }