Jump to content
Software FX Community

Export/import chart


User (Legacy)

Recommended Posts

Hi,

I'm having problems importing chart data from XML files.

First I export from an existing chart, which already has properties set

using the API:

chart1.exportChart(FileFormat.XML,"C:/Documents and

Settings/Administrator/My Documents/exporttest/test.xml");

This seems to produce sensible XML in the correct file location.

Next I try to import the same same file to another chart:

ChartServer chart2 = new ChartServer(application,request,response );

chart2.importChart(FileFormat.XML,"C:/Documents and

Settings/Administrator/My Documents/exporttest/test.xml");

This produces the following error:

10:10:32,312 ERROR [[jsp]] Servlet.service() for servlet jsp threw exception

java.lang.NullPointerException

at SoftwareFX.ChartFX._PointAttributes.Yx(Unknown Source)

at SoftwareFX.ChartFX._PointAttributes.Vx(Unknown Source)

at SoftwareFX.ChartFX._SeriesAttributes.$$(Unknown Source)

at SoftwareFX.ChartFX.yxyy.vYzz(Unknown Source)

at SoftwareFX.ChartFX.yxyy.vYzz(Unknown Source)

at SoftwareFX.ChartFX.yxyy.VyV(Unknown Source)

at SoftwareFX.ChartFX._ChartCore.zyzW(Unknown Source)

at SoftwareFX.ChartFX._ChartCore.ZXzW(Unknown Source)

at SoftwareFX.ChartFX._ChartCore.YXzW(Unknown Source)

at SoftwareFX.ChartFX._ChartCore.zXzW(Unknown Source)

at SoftwareFX.ChartFX.Chart.importChart(Unknown Source)

at

org.apache.jsp.WEB_002dINF.jsp.constructionChartPanel_jsp._jspService(org.ap

ache.jsp.WEB_002dINF.jsp.constructionChartPanel_jsp:308)

Any help would be much appreciated.

Regards,

Kris

P.S. Some extra info that might help:

Commenting out the second (import) line solves the 'null pointer' exception,

the page displays a 'default' chart.

The following works, using the example from the 'Reading Attributes from

XML' page of the ChartFX guide:

XMLProvider sfxXml = new XMLProvider();

sfxXml.load("C:/Documents and Settings/Administrator/My

Documents/exporttest/data.xml");

chart2.setDataSource(sfxXml);

However, the following produces a blank chart, the binary template being

exported in the usual way:

XMLProvider sfxXml = new XMLProvider();

chart2.importChart(FileFormat.BINARY_TEMPLATE,"C:/Documents and

Settings/Administrator/My

Documents/exporttest/bintemp.bin");

sfxXml.load("C:/Documents and Settings/Administrator/My

Documents/exporttest/data.xml");

chart2.setDataSource(sfxXml);

Replacing my exported XML with the example from the 'Reading Attributes from

XML' page of the ChartFX guide produces the following (slightly different)

error:

10:27:18,031 ERROR [[jsp]] Servlet.service() for servlet jsp threw exception

java.lang.NullPointerException

at SoftwareFX.ChartFX.xxzv.ywyz(Unknown Source)

at SoftwareFX.ChartFX._ChartCore.XYZW(Unknown Source)

at SoftwareFX.ChartFX._ChartCore.xzzW(Unknown Source)

at SoftwareFX.ChartFX.wyxw.yVvW(Unknown Source)

at SoftwareFX.ChartFX._Chart.ZyWz(Unknown Source)

at SoftwareFX.ChartFX._Chart.$vWz(Unknown Source)

at SoftwareFX.ChartFX._Chart.ZvWz(Unknown Source)

at SoftwareFX.ChartFX.Chart.getHtmlTag(Unknown Source)

at

org.apache.jsp.WEB_002dINF.jsp.constructionChartPanel_jsp._jspService(org.ap

ache.jsp.WEB_002dINF.jsp.constructionChartPanel_jsp:335)

Link to comment
Share on other sites

Can you please attach the XML that's producing the problem.

--

Francisco Padron

www.chartfx.com

"Kris" <Kris@incito.com> wrote in message

news:rzQkdrNmFHA.1412@webserver3.softwarefx.com...

> Hi,

>

> I'm having problems importing chart data from XML files.

>

> First I export from an existing chart, which already has properties set

> using the API:

>

> chart1.exportChart(FileFormat.XML,"C:/Documents and

> Settings/Administrator/My Documents/exporttest/test.xml");

>

> This seems to produce sensible XML in the correct file location.

>

> Next I try to import the same same file to another chart:

>

> ChartServer chart2 = new ChartServer(application,request,response );

> chart2.importChart(FileFormat.XML,"C:/Documents and

> Settings/Administrator/My Documents/exporttest/test.xml");

>

> This produces the following error:

>

> 10:10:32,312 ERROR [[jsp]] Servlet.service() for servlet jsp threw

> exception

> java.lang.NullPointerException

> at SoftwareFX.ChartFX._PointAttributes.Yx(Unknown Source)

> at SoftwareFX.ChartFX._PointAttributes.Vx(Unknown Source)

> at SoftwareFX.ChartFX._SeriesAttributes.$$(Unknown Source)

> at SoftwareFX.ChartFX.yxyy.vYzz(Unknown Source)

> at SoftwareFX.ChartFX.yxyy.vYzz(Unknown Source)

> at SoftwareFX.ChartFX.yxyy.VyV(Unknown Source)

> at SoftwareFX.ChartFX._ChartCore.zyzW(Unknown Source)

> at SoftwareFX.ChartFX._ChartCore.ZXzW(Unknown Source)

> at SoftwareFX.ChartFX._ChartCore.YXzW(Unknown Source)

> at SoftwareFX.ChartFX._ChartCore.zXzW(Unknown Source)

> at SoftwareFX.ChartFX.Chart.importChart(Unknown Source)

> at

> org.apache.jsp.WEB_002dINF.jsp.constructionChartPanel_jsp._jspService(org.ap

> ache.jsp.WEB_002dINF.jsp.constructionChartPanel_jsp:308)

>

> Any help would be much appreciated.

>

> Regards,

>

> Kris

>

> P.S. Some extra info that might help:

>

> Commenting out the second (import) line solves the 'null pointer'

> exception,

> the page displays a 'default' chart.

>

> The following works, using the example from the 'Reading Attributes from

> XML' page of the ChartFX guide:

>

> XMLProvider sfxXml = new XMLProvider();

> sfxXml.load("C:/Documents and Settings/Administrator/My

> Documents/exporttest/data.xml");

> chart2.setDataSource(sfxXml);

>

> However, the following produces a blank chart, the binary template being

> exported in the usual way:

>

> XMLProvider sfxXml = new XMLProvider();

> chart2.importChart(FileFormat.BINARY_TEMPLATE,"C:/Documents and

> Settings/Administrator/My

> Documents/exporttest/bintemp.bin");

> sfxXml.load("C:/Documents and Settings/Administrator/My

> Documents/exporttest/data.xml");

> chart2.setDataSource(sfxXml);

>

> Replacing my exported XML with the example from the 'Reading Attributes

> from

> XML' page of the ChartFX guide produces the following (slightly different)

> error:

>

> 10:27:18,031 ERROR [[jsp]] Servlet.service() for servlet jsp threw

> exception

> java.lang.NullPointerException

> at SoftwareFX.ChartFX.xxzv.ywyz(Unknown Source)

> at SoftwareFX.ChartFX._ChartCore.XYZW(Unknown Source)

> at SoftwareFX.ChartFX._ChartCore.xzzW(Unknown Source)

> at SoftwareFX.ChartFX.wyxw.yVvW(Unknown Source)

> at SoftwareFX.ChartFX._Chart.ZyWz(Unknown Source)

> at SoftwareFX.ChartFX._Chart.$vWz(Unknown Source)

> at SoftwareFX.ChartFX._Chart.ZvWz(Unknown Source)

> at SoftwareFX.ChartFX.Chart.getHtmlTag(Unknown Source)

> at

> org.apache.jsp.WEB_002dINF.jsp.constructionChartPanel_jsp._jspService(org.ap

> ache.jsp.WEB_002dINF.jsp.constructionChartPanel_jsp:335)

>

>

>

>

Link to comment
Share on other sites

Hi Francisco,

I downloaded the latest beta and it seems to have solved my problems.

I am now trying to export DATA to xml. Is this possible? I can do it to a

text file, or using the binary format, but not XML. (I know the manual says

"XML will save only visual attributes", but it's not always 100% correct!).

Regards,

Kris

"Software FX Support" <noreply@softwarefx.com> wrote in message

news:MIo7y$UmFHA.3080@webserver3.softwarefx.com...

> Can you please attach the XML that's producing the problem.

>

> --

> Francisco Padron

> www.chartfx.com

>

>

> "Kris" <Kris@incito.com> wrote in message

> news:rzQkdrNmFHA.1412@webserver3.softwarefx.com...

> > Hi,

> >

> > I'm having problems importing chart data from XML files.

> >

> > First I export from an existing chart, which already has properties set

> > using the API:

> >

> > chart1.exportChart(FileFormat.XML,"C:/Documents and

> > Settings/Administrator/My Documents/exporttest/test.xml");

> >

> > This seems to produce sensible XML in the correct file location.

> >

> > Next I try to import the same same file to another chart:

> >

> > ChartServer chart2 = new ChartServer(application,request,response );

> > chart2.importChart(FileFormat.XML,"C:/Documents and

> > Settings/Administrator/My Documents/exporttest/test.xml");

> >

> > This produces the following error:

> >

> > 10:10:32,312 ERROR [[jsp]] Servlet.service() for servlet jsp threw

> > exception

> > java.lang.NullPointerException

> > at SoftwareFX.ChartFX._PointAttributes.Yx(Unknown Source)

> > at SoftwareFX.ChartFX._PointAttributes.Vx(Unknown Source)

> > at SoftwareFX.ChartFX._SeriesAttributes.$$(Unknown Source)

> > at SoftwareFX.ChartFX.yxyy.vYzz(Unknown Source)

> > at SoftwareFX.ChartFX.yxyy.vYzz(Unknown Source)

> > at SoftwareFX.ChartFX.yxyy.VyV(Unknown Source)

> > at SoftwareFX.ChartFX._ChartCore.zyzW(Unknown Source)

> > at SoftwareFX.ChartFX._ChartCore.ZXzW(Unknown Source)

> > at SoftwareFX.ChartFX._ChartCore.YXzW(Unknown Source)

> > at SoftwareFX.ChartFX._ChartCore.zXzW(Unknown Source)

> > at SoftwareFX.ChartFX.Chart.importChart(Unknown Source)

> > at

> >

org.apache.jsp.WEB_002dINF.jsp.constructionChartPanel_jsp._jspService(org.ap

> > ache.jsp.WEB_002dINF.jsp.constructionChartPanel_jsp:308)

> >

> > Any help would be much appreciated.

> >

> > Regards,

> >

> > Kris

> >

> > P.S. Some extra info that might help:

> >

> > Commenting out the second (import) line solves the 'null pointer'

> > exception,

> > the page displays a 'default' chart.

> >

> > The following works, using the example from the 'Reading Attributes from

> > XML' page of the ChartFX guide:

> >

> > XMLProvider sfxXml = new XMLProvider();

> > sfxXml.load("C:/Documents and Settings/Administrator/My

> > Documents/exporttest/data.xml");

> > chart2.setDataSource(sfxXml);

> >

> > However, the following produces a blank chart, the binary template being

> > exported in the usual way:

> >

> > XMLProvider sfxXml = new XMLProvider();

> > chart2.importChart(FileFormat.BINARY_TEMPLATE,"C:/Documents and

> > Settings/Administrator/My

> > Documents/exporttest/bintemp.bin");

> > sfxXml.load("C:/Documents and Settings/Administrator/My

> > Documents/exporttest/data.xml");

> > chart2.setDataSource(sfxXml);

> >

> > Replacing my exported XML with the example from the 'Reading Attributes

> > from

> > XML' page of the ChartFX guide produces the following (slightly

different)

> > error:

> >

> > 10:27:18,031 ERROR [[jsp]] Servlet.service() for servlet jsp threw

> > exception

> > java.lang.NullPointerException

> > at SoftwareFX.ChartFX.xxzv.ywyz(Unknown Source)

> > at SoftwareFX.ChartFX._ChartCore.XYZW(Unknown Source)

> > at SoftwareFX.ChartFX._ChartCore.xzzW(Unknown Source)

> > at SoftwareFX.ChartFX.wyxw.yVvW(Unknown Source)

> > at SoftwareFX.ChartFX._Chart.ZyWz(Unknown Source)

> > at SoftwareFX.ChartFX._Chart.$vWz(Unknown Source)

> > at SoftwareFX.ChartFX._Chart.ZvWz(Unknown Source)

> > at SoftwareFX.ChartFX.Chart.getHtmlTag(Unknown Source)

> > at

> >

org.apache.jsp.WEB_002dINF.jsp.constructionChartPanel_jsp._jspService(org.ap

> > ache.jsp.WEB_002dINF.jsp.constructionChartPanel_jsp:335)

> >

> >

> >

> >

>

>

Link to comment
Share on other sites

  • 2 weeks later...

Dear Kris,

I am sorry but at that this time XML export and import is reserved for

visual attributes

You pass data to chartfx using the XmlDataProvider but you can't output xml.

We have never really seen a real use case to get data out from the chart but

perhaps your case is a "real case"?

-cjs

"Kris" <Kris@incito.com> wrote in message

news:tK0Vz8amFHA.3080@webserver3.softwarefx.com...

> Hi Francisco,

>

> I downloaded the latest beta and it seems to have solved my problems.

>

> I am now trying to export DATA to xml. Is this possible? I can do it to a

> text file, or using the binary format, but not XML. (I know the manual

> says

> "XML will save only visual attributes", but it's not always 100%

> correct!).

>

> Regards,

>

> Kris

>

>

>

>

> "Software FX Support" <noreply@softwarefx.com> wrote in message

> news:MIo7y$UmFHA.3080@webserver3.softwarefx.com...

>> Can you please attach the XML that's producing the problem.

>>

>> --

>> Francisco Padron

>> www.chartfx.com

>>

>>

>> "Kris" <Kris@incito.com> wrote in message

>> news:rzQkdrNmFHA.1412@webserver3.softwarefx.com...

>> > Hi,

>> >

>> > I'm having problems importing chart data from XML files.

>> >

>> > First I export from an existing chart, which already has properties set

>> > using the API:

>> >

>> > chart1.exportChart(FileFormat.XML,"C:/Documents and

>> > Settings/Administrator/My Documents/exporttest/test.xml");

>> >

>> > This seems to produce sensible XML in the correct file location.

>> >

>> > Next I try to import the same same file to another chart:

>> >

>> > ChartServer chart2 = new ChartServer(application,request,response );

>> > chart2.importChart(FileFormat.XML,"C:/Documents and

>> > Settings/Administrator/My Documents/exporttest/test.xml");

>> >

>> > This produces the following error:

>> >

>> > 10:10:32,312 ERROR [[jsp]] Servlet.service() for servlet jsp threw

>> > exception

>> > java.lang.NullPointerException

>> > at SoftwareFX.ChartFX._PointAttributes.Yx(Unknown Source)

>> > at SoftwareFX.ChartFX._PointAttributes.Vx(Unknown Source)

>> > at SoftwareFX.ChartFX._SeriesAttributes.$$(Unknown Source)

>> > at SoftwareFX.ChartFX.yxyy.vYzz(Unknown Source)

>> > at SoftwareFX.ChartFX.yxyy.vYzz(Unknown Source)

>> > at SoftwareFX.ChartFX.yxyy.VyV(Unknown Source)

>> > at SoftwareFX.ChartFX._ChartCore.zyzW(Unknown Source)

>> > at SoftwareFX.ChartFX._ChartCore.ZXzW(Unknown Source)

>> > at SoftwareFX.ChartFX._ChartCore.YXzW(Unknown Source)

>> > at SoftwareFX.ChartFX._ChartCore.zXzW(Unknown Source)

>> > at SoftwareFX.ChartFX.Chart.importChart(Unknown Source)

>> > at

>> >

> org.apache.jsp.WEB_002dINF.jsp.constructionChartPanel_jsp._jspService(org.ap

>> > ache.jsp.WEB_002dINF.jsp.constructionChartPanel_jsp:308)

>> >

>> > Any help would be much appreciated.

>> >

>> > Regards,

>> >

>> > Kris

>> >

>> > P.S. Some extra info that might help:

>> >

>> > Commenting out the second (import) line solves the 'null pointer'

>> > exception,

>> > the page displays a 'default' chart.

>> >

>> > The following works, using the example from the 'Reading Attributes

>> > from

>> > XML' page of the ChartFX guide:

>> >

>> > XMLProvider sfxXml = new XMLProvider();

>> > sfxXml.load("C:/Documents and Settings/Administrator/My

>> > Documents/exporttest/data.xml");

>> > chart2.setDataSource(sfxXml);

>> >

>> > However, the following produces a blank chart, the binary template

>> > being

>> > exported in the usual way:

>> >

>> > XMLProvider sfxXml = new XMLProvider();

>> > chart2.importChart(FileFormat.BINARY_TEMPLATE,"C:/Documents and

>> > Settings/Administrator/My

>> > Documents/exporttest/bintemp.bin");

>> > sfxXml.load("C:/Documents and Settings/Administrator/My

>> > Documents/exporttest/data.xml");

>> > chart2.setDataSource(sfxXml);

>> >

>> > Replacing my exported XML with the example from the 'Reading Attributes

>> > from

>> > XML' page of the ChartFX guide produces the following (slightly

> different)

>> > error:

>> >

>> > 10:27:18,031 ERROR [[jsp]] Servlet.service() for servlet jsp threw

>> > exception

>> > java.lang.NullPointerException

>> > at SoftwareFX.ChartFX.xxzv.ywyz(Unknown Source)

>> > at SoftwareFX.ChartFX._ChartCore.XYZW(Unknown Source)

>> > at SoftwareFX.ChartFX._ChartCore.xzzW(Unknown Source)

>> > at SoftwareFX.ChartFX.wyxw.yVvW(Unknown Source)

>> > at SoftwareFX.ChartFX._Chart.ZyWz(Unknown Source)

>> > at SoftwareFX.ChartFX._Chart.$vWz(Unknown Source)

>> > at SoftwareFX.ChartFX._Chart.ZvWz(Unknown Source)

>> > at SoftwareFX.ChartFX.Chart.getHtmlTag(Unknown Source)

>> > at

>> >

> org.apache.jsp.WEB_002dINF.jsp.constructionChartPanel_jsp._jspService(org.ap

>> > ache.jsp.WEB_002dINF.jsp.constructionChartPanel_jsp:335)

>> >

>> >

>> >

>> >

>>

>>

>

>

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...