Hi,
I figured out, that nullvalues (#NV) are not displayed when chart.toImage() is called
(using Aspose 7.0.0.3 )
Here is my code. the excel looks fine, but the image does not show “#NV” for value1
import java.util.Locale;
import com.aspose.cells.Cells;
import com.aspose.cells.Chart;
import com.aspose.cells.ChartCollection;
import com.aspose.cells.ChartType;
import com.aspose.cells.SeriesCollection;
import com.aspose.cells.Workbook;
import com.aspose.cells.Worksheet;
import com.aspose.cells.WorksheetCollection;
public class NullValuesInImage
{
public static void main(final String[] args) throws Exception
{
// Instantiating a Workbook object
Workbook workbook = new Workbook();
Locale.setDefault(Locale.US);
// Obtaining the reference of the first worksheet
WorksheetCollection worksheets = workbook.getWorksheets();
Worksheet sheet = worksheets.get(0);
ChartCollection charts = sheet.getCharts();
int chartIndex = charts.add(ChartType.COLUMN, 5, 0, 15, 5);
Chart chart = charts.get(chartIndex);
Cells cells = sheet.getCells();
cells.get(“A2”).putValue(“Category”);
cells.get(“B1”).putValue(“Value1”);
cells.get(“B2”).setFormula(“=NA()”);
cells.get(“C1”).putValue(“Value2”);
cells.get(“C2”).putValue(2d);
SeriesCollection nSeries = chart.getNSeries();
nSeries.add(“B2:C2”, true);
// set labels for every series
nSeries.setCategoryData(“A2”);
nSeries.get(0).setName(“=B1”);
nSeries.get(1).setName(“=C1”);
// show values
nSeries.get(0).getDataLabels().setShowValue(true);
nSeries.get(1).getDataLabels().setShowValue(true);
// save image
chart.toImage(“outmytestingimg.jpg”);
// save excel
workbook.save(“outmytesting.xls”);
System.out.println(“finished”);
}
}
excel screen:
image:
Can you please provide me an update for that issue
Thank you
Hi,
I have tested your issue with your sample code and found the issue in the generated chart image as your mentioned. I have logged an issue with an id: CELLSJAVA-30477.
We will figure your issue out soon.
Thank you.
Hi,
Please try the attached version (v7.0.1.2), we have solved the “#N/A” issue.
Thank you.
<span style=“font-size:11.0pt;font-family:“Calibri”,“sans-serif”;
mso-fareast-language:ZH-CN”><o:p></o:p>
The issues you have found earlier (filed as 30477) have been fixed in this update.
This message was posted using Notification2Forum from Downloads module by aspose.notifier.