How to import chart from xml file

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Technicon
Newbie
Newbie
Posts: 43
Joined: Thu Aug 11, 2016 12:00 am
Contact:

How to import chart from xml file

Post by Technicon » Tue Sep 27, 2016 11:13 am

Hi,

In teeChart editor there is option to export chart to *.tee, *.xml or text file, but how to import chart from xml file or text file. I found only method to import *.tee file.

Best Regards,
Grzegorz

Yeray
Site Admin
Site Admin
Posts: 9514
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: How to import chart from xml file

Post by Yeray » Tue Sep 27, 2016 12:21 pm

Hello Grzegorz,

You can not import full chart settings from XML/Text except you do it manually. However, you can import chart's series and data from an XML/Text file as shown in the All Features\Welcome!\Components\XML Import source and All Features\Welcome!\Components\Text Source examples at the Features Demo shipped with the binary installation.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Technicon
Newbie
Newbie
Posts: 43
Joined: Thu Aug 11, 2016 12:00 am
Contact:

Re: How to import chart from xml file

Post by Technicon » Wed Sep 28, 2016 6:02 am

Hi,

I found examples how to load data from xml but data xml have different structure eg. point element

Code: Select all

<chart>
<series title="C1 - Licznik energii cieplnej [GJ]" type="Liniowy" color="#4466A3">
<points count="2689">
<point  X="41306" Y="0,0934295654296875"/>
<point  X="41306,0104166667" Y="0,0934295654296875"/>
<point  X="41306,0208333333" Y="0,0933380126953125"/>
...
When exporting chart to xml (with data) the xml structure look like this

Code: Select all

  <TLineSeries>
    <Title value="'C1 - Licznik energii cieplnej [GJ]'"/>
    <Brush>
      <BackColor value="clDefault"/>
    </Brush>
    <InvertedStairs value="True"/>
    <Pointer>
      <InflateMargins value="True"/>
      <Style value="psRectangle"/>
    </Pointer>
    <Stairs value="True"/>
    <XValues>
      <DateTime value="True"/>
      <Name value="'X'"/>
      <Order value="loAscending"/>
      <ValueSource value="'dt_date'"/>
    </XValues>
    <YValues>
      <Name value="'Y'"/>
      <Order value="loNone"/>
      <ValueSource value="'dw_value_L'"/>
    </YValues>
    <Data>
      <String value="01810A000000000000402BE4400000000000EBB73F55555555402BE44000000"/>
      <String value="0000EBB73FABAAAAAA402BE4400000000000E5B73F00000000412BE44000000"/>
      <String value="0000A3B73F55555555412BE4400000000000B9B73FABAAAAAA412BE44000000"/>
      <String value="0000CCB73F00000000422BE440000000000012B83F55555555422BE44000000"/>
...


How one can use such exported file?
How to decode <Data> <String value="01810A000000000000402BE4400000000000EBB73F55555555402BE44000000"/>?
Did you provide some components to handle this format or it's only for future purpose?

Best Regards,
Grzegorz

Yeray
Site Admin
Site Admin
Posts: 9514
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: How to import chart from xml file

Post by Yeray » Wed Sep 28, 2016 10:41 am

Hello Grzegorz,
Technicon wrote:How one can use such exported file?
This exportation allows you to obtain a readable xml output with the objects and properties defined in a chart, but the xml generated can't be imported.
The native option designed to be importable is the .tee, in binary or text format.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply