コード例 #1
0
 private void ChartTypeButton_Click(object sender, EventArgs e)
 {
     try
     {
         SeriesChartType t = (SeriesChartType)Enum.Parse(typeof(SeriesChartType), sender.ToString());
         Properties.Settings.Default.DefaultChartType = t.ToString();
         foreach (ToolStripMenuItem item in this.menuItemChartTypes.DropDownItems)
         {
             item.Checked = false;
         }
         (sender as ToolStripMenuItem).Checked = true;
         foreach (Series se in chart1.Series)
         {
             se.ChartType = t;
         }
         foreach (Series s in _bkSeries)
         {
             s.ChartType = t;
         }
     }
     catch (System.Exception ee)
     {
         InvokeOnLog((MsgEventArgs)ee.Message);
     }
     return;
 }
コード例 #2
0
ファイル: Chart2D.cs プロジェクト: uecom/Computator.NET
        private void setupChartTypes(ToolStripComboBox owner)
        {
            var items =
                Enum.GetValues(typeof(SeriesChartType))
                .Cast <SeriesChartType>()
                .ToList();

            owner.Items.Clear();

            foreach (var v in items)
            {
                owner.Items.Add(v.ToString());
            }

            owner.DropDownStyle = ComboBoxStyle.DropDownList;
            owner.AutoSize      = true;

            owner.SelectedItem = defaultExplicitFunctionsChartType.ToString();
            //  chartType = SeriesChartType.FastLine;
        }