Hi,
We are using Chartfx 7.0 for java here at
the census bureau. As long as we use the renderControl() method, the chart
renders fine and we are able to access the charts via the AJAX
toolbar.
However, there are use cases where we need to generate the chart
as an image and embed them in PDF reports. We are trying to use the
exportChart() method for this and trying to create a PNG image as shown in the code example below ....
However, the image produced by this method shows
"Invalid ChartFX licenese" message.
Below is the source sample for
this.
private File getChartFile(ChartData chartData, FileFormat
fileFormat, Gallery gallery, AxisFormat axisFormat, int width, int height)
{
ChartServer chart1 = new ChartServer();
//
Feeds in the chart data to chart server
initChart(chart1,
chartData);
File tempFile = null;
chart1.setGallery(gallery);
try {
tempFile = File.createTempFile("euschartfx", ".cfx");
FileOutputStream ostream = new FileOutputStream(tempFile);
chart1.setFileContents(EnumSet.of(FileContents.ALL));
chart1.exportChart(fileFormat, ostream);
ostream.close();
} catch (IOException e)
{
ExceptionController.getGenericException().handleAjaxWithRedirect(e);
}
return tempFile;
}
What are we
missing here?
Thanks, -- Vishal IBM / Census Bureau