public static void SetChartType(SeriesChartType type, ref Chart[] charts) { if (charts == null) return; foreach (Chart chart in charts) chart.Series[0].ChartType = type; }