公告
财富商城
积分规则
提问
发文
2019-01-23 14:24发布
再贱就再见
How can I remove grid lines from chart? I use standard Chart library.
Thanks!
If you're just using the designer, you can navigate your way to the MajorGrid property like this...
You can disable MajorGrid or MinorGrid of each of the axis of the desired chart-area:
MajorGrid
MinorGrid
mainChart.ChartAreas[0].AxisX.MajorGrid.Enabled = false; mainChart.ChartAreas[0].AxisX.MinorGrid.Enabled = false; mainChart.ChartAreas[0].AxisY.MajorGrid.Enabled = false; mainChart.ChartAreas[0].AxisY.MinorGrid.Enabled = false;
as seen below: https://github.com/sinairv/MSChartWrapper/blob/master/MSChartWrapper/ChartWrapper.cs#L58-L61
Assuming a single ChartArea, you can try these settings:
chart1.ChartAreas[0].AxisX.MajorGrid.LineWidth = 0; chart1.ChartAreas[0].AxisY.MajorGrid.LineWidth = 0;
Otherwise you may want to use:
chart1.ChartAreas["ChartArea1"].AxisX.MajorGrid.LineWidth = 0; chart1.ChartAreas["ChartArea1"].AxisY.MajorGrid.LineWidth = 0;
where, "ChartArea1" is the Series Property-->Chart-->Chart Area "ChartArea1"
最多设置5个标签!
If you're just using the designer, you can navigate your way to the MajorGrid property like this...
You can disable
MajorGrid
orMinorGrid
of each of the axis of the desired chart-area:as seen below: https://github.com/sinairv/MSChartWrapper/blob/master/MSChartWrapper/ChartWrapper.cs#L58-L61
Assuming a single ChartArea, you can try these settings:
Otherwise you may want to use:
where, "ChartArea1" is the Series Property-->Chart-->Chart Area "ChartArea1"