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

Free Support Forum - aspose.com

DataPoint shapeX wrong

Workbook wb = new Workbook("C:/柱状图.xlsx");
Worksheet worksheet = wb.getWorksheets().get(0);
Chart chart = worksheet.getCharts().get("图表 1");
chart.calculate();
Series series0 = chart.getNSeries().get(0);
Series series1 = chart.getNSeries().get(1);
Series series2 = chart.getNSeries().get(2);
Series series3 = chart.getNSeries().get(3);
Series series4 = chart.getNSeries().get(4);
String name0 = series0.getDisplayName();
String name1 = series1.getDisplayName();
String name2 = series2.getDisplayName();
String name3 = series3.getDisplayName();
String name4 = series4.getDisplayName();
System.out.println(name0 + "," + name1 + "," + name2 + "," + name3 + "," + name4);
ChartPoint point0 = series0.getPoints().get(0);
ChartPoint point1 = series1.getPoints().get(0);
ChartPoint point2 = series2.getPoints().get(0);
ChartPoint point3 = series3.getPoints().get(0);
ChartPoint point4 = series4.getPoints().get(0);
System.out.println(point0.getShapeX());
System.out.println(point1.getShapeX());
System.out.println(point2.getShapeX());
System.out.println(point3.getShapeX());
System.out.println(point4.getShapeX());


东北,华北,华东,华南,西南
796
1391
796
2583
3178



Only point2 is wrong, it return equals point0 but it should between point1 and point3

Hi,


Thanks for providing us template file aned sample code.

After an initial test, I observed the issue as you mentioned after using your sample code with your template file. I found that the third DataPoint’s ShapeX gives wrong value for the chart after calling Chart.calculate() method. It should be somewhere around 2000 but it gives same value as per first data point. I have logged a ticket with an id “CELLSJAVA-41871” for your issue. We will look into it soon.

Once we have an update on it, we will let you know here.

Thank you.

Hi,


Please try our latest version/fix: Aspose.Cells for Java v8.8.2.7 (attached).

We have fixed your issue now.

Let us know your feedback.

Thank you.