@Majeed Purseyedmahdi , about your second question, you could refer to the following code to use combobox to load different types in chart.
private void Form1_Load(object sender, EventArgs e)
{
fillChart();
var resourceStream = typeof(System.Windows.Forms.DataVisualization.Charting.Chart)
.Assembly.GetManifestResourceStream("System.Windows.Forms.DataVisualization.Charting.Design.resources");
using (System.Resources.ResourceReader resReader = new ResourceReader(resourceStream))
{
var dictEnumerator = resReader.GetEnumerator();
while (dictEnumerator.MoveNext())
{
var ent = dictEnumerator.Entry;
comboBox1.Items.Add(ent.Key);
}
}
}
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
Console.WriteLine(comboBox1.SelectedItem.ToString().Replace("ChartType",""));
string a = comboBox1.SelectedItem.ToString().Replace("ChartType", "");
SeriesChartType type = (SeriesChartType)Enum.Parse(typeof(SeriesChartType), a);
chart1.Series[0].ChartType = type;
}
Result:
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.