C# 的隨手筆記 1 - 設定 Chart 的網格 粗細 與 格式

 Chart 的網格 粗細 與 格式

        private void comboBox_Line_Style1_SelectedIndexChanged(object sender, EventArgs e)
        {

            chart_data1.ChartAreas[0].AxisX.MajorGrid.LineWidth = 1;
            chart_data1.ChartAreas[0].AxisY.MajorGrid.LineWidth = 1;

            chart_data1.ChartAreas[0].AxisX.MajorGrid.LineDashStyle
                = (ChartDashStyle) comboBox_YH_Line_Style1.SelectedIndex;

            chart_data1.ChartAreas[0].AxisY.MajorGrid.LineDashStyle
                = (ChartDashStyle) comboBox_YH_Line_Style1.SelectedIndex;

        }

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

https://learn.microsoft.com/zh-tw/dotnet/api/system.web.ui.datavisualization.charting.chartdashstyle?view=netframework-4.8.1

https://learn.microsoft.com/zh-tw/dotnet/api/system.web.ui.datavisualization.charting.axis.linedashstyle?view=netframework-4.8.1