Overlapping of dual Bar Charts

Hi Aspose Team,

I am trying to plot a DualAxisVerticalBarChart in an excel but when I am trying that 2 bars are overlapping

Expected : Dual-Bar Expected.png

Actual (what I am getting): Dual-Bar with overlapping issue.png

can you please advice me how to achieve expected chat.

@mseelam11,

We could not find your screenshots or attachments. Please provide the following to evaluate your issue precisely on our end:

  1. Sample code (runnable) that you are currently using using Aspose.Cells API
  2. Any input Excel file if you are using.
  3. Output Excel file generated by Aspose.Cells.
  4. A sample Excel file having your expected chart in it, you may create your desired chart using MS Excel manually and save the file.

PS. please zip the Excel files prior attaching here.

Sorry forgot to attach.

Dual-Bar with overlapping issue.PNG (5.7 KB)
Dual-Bar Expected.PNG (5.9 KB)

Amjad,

Please see the sttached Zip file which has the Sample bar chart created in the excel manually.
below is the data I am using to plot the bar charts
input excel the data is there in the excel that I attached.

Excel.zip (10.5 KB)

@mseelam11,
Please share your sample runnable console application (as requested by @Amjad_Sahi also) that can be used to generate the Excel file having the issue as shown in image “Dual-Bar with overlapping issue.png” above. We will reproduce the issue here and share our feedback accordingly.

Also, share your environment details like the operating system, Java version etc. You may ensure that you are using the latest version Aspose.Cells for Java 20.10 in your testing as we rectify issues in the latest versions only.

@mseelam11,

Please try to use Series.setGapWidth() and Series.setOverlap() methods to set the gap accordingly especially for the second series. See the sample code for your reference, so you may accommodate or update your code accordingly:
e.g.
Sample code:

.......
//Plot the second series on second axis line.
Integer obj1 = 150;
short value = obj1.shortValue();
chart.getNSeries().get(1).setGapWidth(value);
Integer obj2 = 0;
short value1 = obj2.shortValue();
chart.getNSeries().get(1).setOverlap(value1);
chart.getNSeries().get(1).setPlotOnSecondAxis(true); 

Hope, this helps a bit.