Graph Without GridLinesI am trying to create a chart in excel file using epplus and c#. I am able to create graph , I am trying to remove the gridlines in graph as shown in the images . I found solution to do it in windows application , but i wanted to do it in web application , below is the code i use to generate graph.
ExcelRange erLossesRangeMacInv = worksheet.Cells["G5:G10"];
var chartOEE=(ExcelBarChart)worksheetGraph.Drawings.AddChart("barChartOEE", eChartType.ColumnClustered);
chartOEE.SetSize(300, 300);//Setting size of graph
chartOEE.SetPosition(10, 10); // position of graph in excel
chartOEE.Title.Text = "OEE";
ExcelRange erLossesRangeOEE = worksheet.Cells["M5:M10"];
chartOEE.Style = eChartStyle.Style10;
chartOEE.Legend.Remove();
chartOEE.DataLabel.ShowValue = true;
chartOEE.YAxis.MaxValue = 100;
chartOEE.Series.Add(erLossesRangeOEE, erLossesRangeMacInv);
I have found code that does work in windows forms.
chartOEE.ChartAreas["ChartArea1"].AxisX.MajorGrid.Enabled = false;
How to do it in "Web Application" using epplus and c#.
UPDATE
I created a PR which has been accepted that allow removing grid lines. Should will be in the next release (whenever that is) so look out for it:
https://epplus.codeplex.com/SourceControl/network/forks/aesalazar/Epplus/contribution/9025
https://github.com/JanKallman/EPPlus/blob/master/EPPlus/Drawing/Chart/ExcelChartAxis.cs#L895
Which can be used like this:
ORIGINAL
Its strange that they have not added that as an option to
EPPlus
since it only requires basic xml manipulation. Web or desktop should make no difference as far as EPPlus goes, you simply need to remove the xml references. This should do it:Which gives this: