Hi,
How can I position a chart in excel to begin from the middle of a cell? I think older version of Aspose.Cells accept additional parameters to set horizontal and vertical offset inside left top cell. How can I do this in latest version of Aspose.Cells for java?
Hi,
- Chart.getChartObject().setLowerDeltaX(value);
- Chart.getChartObject().setLowerDeltaY(value);
- Chart.getChartObject().setUpperDeltaX(value);
- Chart.getChartObject().setUpperDeltaY(value);
Hi,
Couple of questions…
2) How can I position the chart to start from centre of a cell and end at quarter position of a cell - ie How can we pass different values for lower and upper deltas?
Hi,
Shape.LowerDeltaX PropertyGets or sets the shape’s horizontal offset from its lower right corner column. The range of value is 0 to 1024.public int LowerDeltaX {get; set;}
Hi,
Please help me to resolve this issue mentioned in Qst-2. Please refer screenshots Aspose500_0.PNG, Aspose500_250.PNG. That seems to be not working as expected.
2) How can I position the chart to start from centre of a cell and end at quarter position of a cell - ie How can we pass different values for lower and upper deltas?
Hi,
Hi,
Can you try the following sample code and explain me why the highlighted code does not make any difference.
chart.getChartObject().setUpperDeltaX(1024 * 3 / 4);
//Option 2
//Option 3
Thanks
Hi,
Worksheet sheet = workbook.getWorksheets().get(0);
Cells cells = sheet.getCells();
cells.get(0, 1).putValue(“Income”);
cells.get(1, 0).putValue(“Company A”);
cells.get(2, 0).putValue(“Company B”);
cells.get(3, 0).putValue(“Company C”);
cells.get(1, 1).putValue(10000);
cells.get(2, 1).putValue(20000);
cells.get(3, 1).putValue(30000);
int chartIndex = sheet.getCharts().add(ChartType.COLUMN, 1, 2, 12, 8);
Chart chart = sheet.getCharts().get(chartIndex);
// Option 1
chart.getChartObject().setUpperDeltaX(1024 * 3 / 4);
chart.getChartObject().setLowerDeltaX(1024 * 1 / 4);
// Option 2
chart.getChartObject().setUpperDeltaX(1024 * 1 / 4);
chart.getChartObject().setLowerDeltaX(1024 * 1 / 4);
// Option 3
chart.getChartObject().setUpperDeltaX(1024 * 1 / 2);
chart.getChartObject().setLowerDeltaX(1024 * 1 / 4);
// chart.getChartObject().setUpperDeltaY(256 / 2);
// chart.getChartObject().setLowerDeltaY(256 / 4);
chart.getNSeries().add(“B2:B4”, true);
chart.getNSeries().setCategoryData(“A2:A4”);
Series aSeries = chart.getNSeries().get(0);
aSeries.setName("=B1");
chart.setShowLegend(true);
chart.getTitle().setText(“Income Analysis”);
workbook.save(dirPath + “out.xlsx”);
Hi,
I have attached the expected excel file. You can see the image with offset highlighted.
Thanks
Hi,
Hi,
- CELLSJAVA-42140 - DeltaX does not update the chart dimension properly
int width = chart.getChartObject().getWidth() + sheet.getCells().getColumnWidthPixel(chart.getChartObject().getLowerRightColumn())/2;
chart.getChartObject().setWidth(width);
Hi again,
Hi,
Hi again,