getMajorGridLines() is not wokring for category axis

I am implementing scatter chart.and needs to set MajorGridLines for both X- axis & Y-axis.

chart.getCategoryAxis().getMajorGridLines().setDashType(MsoLineDashStyle.SQUARE_DOT);
chart.getValueAxis().getMajorGridLines().setDashType(MsoLineDashStyle.SQUARE_DOT);



the above piece of code drawing major grid lines for value axis but not for category axis.

Please help me on this, Thanks in advance.

Hi,


Thanks for providing some details.

Could you create the sample chart with your desired major Gridlines’ dash style for category axis lines in Ms Excel manually, save the file and post us here, we will check it soon. Also provide the chart via Aspose.Cells APIs.

Thank you.

Done.

Thanks for your quick response.

Please find the attachment and go thru all the sheets.

Regards,
S Vinoth

Hi,

Thanks for the template file.

I have tested your scenario/ case a bit. I used the following sample code with v8.3.2.7 (please try it), it works fine and vertical gridlines are shown correctly, please refer to the following sample code.

e.g

Sample code:

Workbook workBook = new Workbook(“Chart±+Excel.xlsx”);

Chart chart = workBook.getWorksheets().get(1).getCharts().get(0);

**chart.getCategoryAxis().getMajorGridLines().setVisible(true);**

//chart.getCategoryAxis().getMajorGridLines().setColor(com.aspose.cells.Color.getBlack());

**chart.getCategoryAxis().getMajorGridLines().setDashType(MsoLineDashStyle.SQUARE_DOT);**

workBook.save(“outChart±+Excel1.xlsx”);

Thank you.

So Cool… It’s working…

Thanks ! Thanks a lot !!

Hi,


Good to know that your issue is sorted out now. Feel free to contact us any time if you need further help or have some other issue or queries, we will be happy to assist you soon.

Thank you.