We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Issue with MajorGridLines color (VB.NET)


I have begun to test your new version of Aspose.Cells in order to buy it soon because our version is obsolete now but I encounter some problems so I’ll certainly come sometimes here from now on.

This time it’s the MajorGridLines that I can’t use properly. I wanted to change the color of the background grid of my chart, I did like this
Dim Graphique As Charts.Chart = mySheet.Charts(0)
Graphique.PlotArea.Area.ForegroundColor = Color.FromArgb(0, 255, 255, 255)
Graphique.PlotArea.Border.IsVisible = False
Graphique.CategoryAxis.MajorGridLines.IsVisible = True
Graphique.CategoryAxis.MajorGridLines.Color = Color.FromArgb(0, 170, 170, 170)
Graphique.ValueAxis.MajorGridLines.Color = Color.FromArgb(0, 170, 170, 170)
Graphique.ValueAxis.AxisLine.Color = Color.Red
Graphique.CategoryAxis.AxisLine.Color = Color.FromArgb(0, 170, 170, 170)
Graphique.ChartArea.Area.ForegroundColor = Color.FromArgb(0, 255, 255, 255)

I don’t know why but my AxisLine is in the right color but not my grid.
You’ll find the result in enclosure. Thanks


Please try the attached latest version/fix v5.1.1.1. It might be an issue with previous version(s). I have tested with it and the gridlines color is set fine.

Thank you.


Following code changes will work:

' Given below (2 lines) code is used to set the color of Vertical & Horizontal grid lines.
Graphique.CategoryAxis.MajorGridLines.Color = Color.Blue ' Vertical lines.
Graphique.ValueAxis.MajorGridLines.Color = Color.YellowGreen ' Horizontal lines.

' Given below (2 lines) code is used to set the color of Vertical & Horizontal axis.
Graphique.ValueAxis.AxisLine.Color = Color.Red ' Vertical Axis.
Graphique.CategoryAxis.AxisLine.Color = Color.Red ' Horizontal Axis.

It is tested with version


I used the ddl as you suggested it and it works, thanks a lot. I’ll pay attention to the dll fixes next time.