Jump to content
Software FX Community

Certain chart properties are not exported to XML files


User (Legacy)

Recommended Posts

Hi,

I'm using ChartFX for Java 6.2 (Version 6.2.2266.27659) and I'm having

issues with exporting and re-importing a chart.

Not all properties are written to the exported XML file, despite I'm

explicitly set the fileMask to ALL.

The following snippet shows how I'm creating a chart, setting some

properties and export it to an PNG file as well as an XML template.

Chart c = new Chart();

c.setGallery(Gallery.SCATTER);

TextProvider txtProvider = new TextProvider("data.txt");

txtProvider.setSeparators(";");

c.setDataType(0, DataType.XVALUE);

c.setDataType(1, DataType.VALUE);

c.getAxisX().getLabelsFormat().setFormat(AxisFormat.DATE);

c.setDataSource(txtProvider);

c.setSerLegBox(true);

c.getAxisY().getTitle().setText("Title");

c.getSeries(0).setGallery(Gallery.LINES);

c.setWidth(1024);

c.setHeight(640);

try {

c.setFileMask(c.getFileMask() | FileMask.ALL | FileMask.DATA_BIND);

c.exportChart(FileFormat.PNG,"image.png");

c.exportChart(FileFormat.XML,"chart.xml");

} catch (IOException e) {

e.printStackTrace();

}

The PNG is rendered correctly, but the XML doesn't contain any entries

for the width and the height of the chart (nor any data, despite ALL

should include data, right?).

Hence if the XML is re-imported, the chart has the default dimensions.

Chart c2 = new Chart();

c2.setFileMask(FileMask.ALL);

try {

c2.importChart(FileFormat.XML,"chart.xml");

TextProvider txtProvider = new TextProvider("data.txt");

txtProvider.setSeparators(";");

txtProvider.setDateFormat("yyyy/MM/dd");

c2.setDataSource(txtProvider);

c2.exportChart(FileFormat.PNG,"image_reimport.png");

} catch (IOException e) {

e.printStackTrace();

}

The file image_reimport.png differs in size from image.png.

What could I possibly miss? I've checked the exported XML, and as said

before, there are no <WIDTH> or <HEIGHT> entries. If they are manually

added before re-importing the chart, they wouldn't affect the size neither.

What could be the reason for that issue? Am I miss something obvious

here? Why is the chart data not exported as well? The documentation

states that FileFormat.ALL contains everything and is valid for XML export.

Thanks for any help in advance,

Kurt

Link to comment
Share on other sites

Hi,

I'm using ChartFX for Java 6.2 (Version 6.2.2266.27659) and I'm having

issues with exporting and re-importing a chart.

Not all properties are written to the exported XML file, despite I'm

explicitly set the fileMask to ALL.

The following snippet shows how I'm creating a chart, setting some

properties and export it to an PNG file as well as an XML template.

Chart c = new Chart();

c.setGallery(Gallery.SCATTER);

TextProvider txtProvider = new TextProvider("data.txt");

txtProvider.setSeparators(";");

c.setDataType(0, DataType.XVALUE);

c.setDataType(1, DataType.VALUE);

c.getAxisX().getLabelsFormat().setFormat(AxisFormat.DATE);

c.setDataSource(txtProvider);

c.setSerLegBox(true);

c.getAxisY().getTitle().setText("Title");

c.getSeries(0).setGallery(Gallery.LINES);

c.setWidth(1024);

c.setHeight(640);

try {

c.setFileMask(c.getFileMask() | FileMask.ALL | FileMask.DATA_BIND);

c.exportChart(FileFormat.PNG,"image.png");

c.exportChart(FileFormat.XML,"chart.xml");

} catch (IOException e) {

e.printStackTrace();

}

The PNG is rendered correctly, but the XML doesn't contain any entries

for the width and the height of the chart (nor any data, despite ALL

should include data, right?).

Hence if the XML is re-imported, the chart has the default dimensions.

Chart c2 = new Chart();

c2.setFileMask(FileMask.ALL);

try {

c2.importChart(FileFormat.XML,"chart.xml");

TextProvider txtProvider = new TextProvider("data.txt");

txtProvider.setSeparators(";");

txtProvider.setDateFormat("yyyy/MM/dd");

c2.setDataSource(txtProvider);

c2.exportChart(FileFormat.PNG,"image_reimport.png");

} catch (IOException e) {

e.printStackTrace();

}

The file image_reimport.png differs in size from image.png.

What could I possibly miss? I've checked the exported XML, and as said

before, there are no <WIDTH> or <HEIGHT> entries. If they are manually

added before re-importing the chart, they wouldn't affect the size neither.

What could be the reason for that issue? Am I miss something obvious

here? Why is the chart data not exported as well? The documentation

states that FileFormat.ALL contains everything and is valid for XML export.

Thanks for any help in advance,

Kurt

Link to comment
Share on other sites

The  <WIDTH> and <HEIGHT> are not included whe you export to XML or Binary. 

This is by design, and we are going to change it for future versions.

Regards,

GA

"DI Kurt Edegger" <news_tmp1@edegger.com> wrote in message

news:TgSERmTHHHA.2608@webserver3.softwarefx.com...

> Hi,

>

> I'm using ChartFX for Java 6.2 (Version 6.2.2266.27659) and I'm having

> issues with exporting and re-importing a chart.

> Not all properties are written to the exported XML file, despite I'm

> explicitly set the fileMask to ALL.

>

> The following snippet shows how I'm creating a chart, setting some

> properties and export it to an PNG file as well as an XML temlate.

>

> Chart c = new Chart();

> c.setGallery(Gallery.SCATTER);

> TextProvider txtProvider = new TextProvider("data.txt");

> txtProvider.setSeparators(";");

> c.setDataType(0, DataType.XVALUE);

> c.setDataType(1, DataType.VALUE);

> c.getAxisX().getLabelsFormat().setFormat(AxisFormat.DATE);

> c.setDataSource(txtProvider);

> c.setSerLegBox(true);

> c.getAxisY().getTitle().setText("Title");

> c.getSeries(0).setGallery(Gallery.LINES);

> c.setWidth(1024);

> c.setHeight(640);

> try {

> c.setFileMask(c.getFileMask() | FileMask.ALL | FileMask.DATA_BIND);

> c.exportChart(FileFormat.PNG,"image.png");

> c.exportChart(FileFormat.XML,"chart.xml");

> } catch (IOException e) {

> e.printStackTrace();

> }

>

> The PNG is rendered correctly, but the XML doesn't contain any entries for

> the width and the height of the chart (nor any data, despite ALL should

> include data, right?).

> Hence if the XML is re-imported, the chart has the default dimensions.

>

> Chart c2 = new Chart();

> c2.setFileMask(FileMask.ALL);

> try {

> c2.importChart(FileFormat.XML,"chart.xml");

> TextProvider txtProvider = new TextProvider("data.txt");

> txtProvider.setSeparators(";");

> txtProvider.setDateFormat("yyyy/MM/dd");

> c2.setDataSource(txtProvider);

> c2.exportChart(FileFormat.PNG,"image_reimport.png");

> } catch (IOException e) {

> e.printStackTrace();

> }

>

> The file image_reimport.png differs in size from image.png.

>

> What could I possibly miss? I've checked the exported XML, and as said

> before, there are no <WIDTH> or <HEIGHT> entries. If they are manually

> added before re-importing the chart, they wouldn't affect the size

> neither.

>

> What could be the reason for that issue? Am I miss something obvious here?

> Why is the chart data not exported as well? The documentation states that

> FileFormat.ALL contains everything and is valid for XML export.

>

> Thanks for any help in advance,

>

> Kurt

Link to comment
Share on other sites

The  <WIDTH> and <HEIGHT> are not included whe you export to XML or Binary. 

This is by design, and we are going to change it for future versions.

Regards,

GA

"DI Kurt Edegger" <news_tmp1@edegger.com> wrote in message

news:TgSERmTHHHA.2608@webserver3.softwarefx.com...

> Hi,

>

> I'm using ChartFX for Java 6.2 (Version 6.2.2266.27659) and I'm having

> issues with exporting and re-importing a chart.

> Not all properties are written to the exported XML file, despite I'm

> explicitly set the fileMask to ALL.

>

> The following snippet shows how I'm creating a chart, setting some

> properties and export it to an PNG file as well as an XML temlate.

>

> Chart c = new Chart();

> c.setGallery(Gallery.SCATTER);

> TextProvider txtProvider = new TextProvider("data.txt");

> txtProvider.setSeparators(";");

> c.setDataType(0, DataType.XVALUE);

> c.setDataType(1, DataType.VALUE);

> c.getAxisX().getLabelsFormat().setFormat(AxisFormat.DATE);

> c.setDataSource(txtProvider);

> c.setSerLegBox(true);

> c.getAxisY().getTitle().setText("Title");

> c.getSeries(0).setGallery(Gallery.LINES);

> c.setWidth(1024);

> c.setHeight(640);

> try {

> c.setFileMask(c.getFileMask() | FileMask.ALL | FileMask.DATA_BIND);

> c.exportChart(FileFormat.PNG,"image.png");

> c.exportChart(FileFormat.XML,"chart.xml");

> } catch (IOException e) {

> e.printStackTrace();

> }

>

> The PNG is rendered correctly, but the XML doesn't contain any entries for

> the width and the height of the chart (nor any data, despite ALL should

> include data, right?).

> Hence if the XML is re-imported, the chart has the default dimensions.

>

> Chart c2 = new Chart();

> c2.setFileMask(FileMask.ALL);

> try {

> c2.importChart(FileFormat.XML,"chart.xml");

> TextProvider txtProvider = new TextProvider("data.txt");

> txtProvider.setSeparators(";");

> txtProvider.setDateFormat("yyyy/MM/dd");

> c2.setDataSource(txtProvider);

> c2.exportChart(FileFormat.PNG,"image_reimport.png");

> } catch (IOException e) {

> e.printStackTrace();

> }

>

> The file image_reimport.png differs in size from image.png.

>

> What could I possibly miss? I've checked the exported XML, and as said

> before, there are no <WIDTH> or <HEIGHT> entries. If they are manually

> added before re-importing the chart, they wouldn't affect the size

> neither.

>

> What could be the reason for that issue? Am I miss something obvious here?

> Why is the chart data not exported as well? The documentation states that

> FileFormat.ALL contains everything and is valid for XML export.

>

> Thanks for any help in advance,

>

> Kurt

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...