SVG Charts

View: New views
6 Messages — Rating Filter:   Alert me  

SVG Charts

by Mark Scardigno :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I did not attend the summit and I'm trying to wrap my head around creating SVG charts.

So far I've read about 3 ways (I think) to go about producing SVG charts:

1) 4D SVG Component
2) Creating the SVG XML on the fly
3) Store an SVG XML template and use PROCESS HTML TAGS to customize the chart on the fly

I have many forms in a database that consist of an AreaList and a graph below it.  The user navigates the AreaList rows (sometimes rather quickly) and the chart area is updated automatically with each new row selection.  I currently use 4D Chart, not the GRAPH command.

My question is, which would be the most efficient way of creating these charts using SVG?  Also, if producing the SVG XML on the fly is the best approach, which mode, DOM or SAX?  I'm assuming DOM, since most will hold minimal XML data.

Lastly, will 4D Chart eventually be phased out?

Many Thanks,
Mark.**********************************************************************
Get up to $600 to spend on Amazon.com
this holiday season - http://www.4d.com/serverpromo.html


4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4D.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4D_Tech-Unsubscribe@...
**********************************************************************

Parent Message unknown Re: SVG Charts

by Keith Culotta :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Mark,

The easiest way I've found is to use the GRAPH command (page 681), but declare the graphArea as a C_Picture(graphArea).

Then with the 4D SVG Component you can use this if you need the XML text:

$svgRef:=SVG_Open_picture (graphArea)
$text:=SVG_Export_to_XML ($svgRef)

Keith
Computer Dimensions, Inc.
409-866-8378

On Nov 12, 2009, at 12:41 PM, 4d_tech-request@... wrote:

> So far I've read about 3 ways (I think) to go about producing SVG charts:
>
> 1) 4D SVG Component
> 2) Creating the SVG XML on the fly
> 3) Store an SVG XML template and use PROCESS HTML TAGS to customize the chart on the fly
>
> I have many forms in a database that consist of an AreaList and a graph below it.  The user navigates the AreaList rows (sometimes rather quickly) and the chart area is updated automatically with each new row selection.  I currently use 4D Chart, not the GRAPH command.
>
> My question is, which would be the most efficient way of creating these charts using SVG?  Also, if producing the SVG XML on the fly is the best approach, which mode, DOM or SAX?  I'm assuming DOM, since most will hold minimal XML data.
>
> Lastly, will 4D Chart eventually be phased out?
>
> Many Thanks,
> Mark.

**********************************************************************
Get up to $600 to spend on Amazon.com
this holiday season - http://www.4d.com/serverpromo.html


4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4D.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4D_Tech-Unsubscribe@...
**********************************************************************

Parent Message unknown RE: SVG Charts

by Thomas Fitch :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Mark,

> 1) 4D SVG Component
> 2) Creating the SVG XML on the fly
> 3) Store an SVG XML template and use PROCESS HTML TAGS to customize the
> chart on the fly

Although perhaps the easiest way to handle this is with the GRAPH command it
definitely does not give you the most control. I would suggest that you use
#1 or #3. The 4D SVG Component is really just creating and editing XML at an
abstracted (and easier to understand and manipulate) level.

I am most familiar with using the SVG Component to build your SVG on the
fly. Each time you scroll through the arealist rows that chart will change
and you will rebuild your SVG. Depending on the number of elements in the
SVG image it is usually very fast. In the charts I have built it is fast
enough to recreate the SVG on resize (as you drag the window) so I would
assume it is fast enough for scrolling through list items.

Kind Regards,

Tom Fitch
Technical Services Team Member
4D, Inc.

**********************************************************************
Get up to $600 to spend on Amazon.com
this holiday season - http://www.4d.com/serverpromo.html
   

4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4D.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4D_Tech-Unsubscribe@...
**********************************************************************

Parent Message unknown Re: SVG Charts

by Mark Scardigno :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Keith,

Thank you for your response.  I am currently using 4D Chart.  Using the GRAPH command leaves me with only the GRAPH SETTINGS command to customize the chart.  That command is lacking.  For example, I would rather not have a legend and y-axis labels.

Are you suggesting that I use SVG_Export_to_XML in order to get at the xml source and customize it on the fly (remove legend, y-axis labels, etc.).  Then, export it back to picture?

Many Thanks,
Mark.

On Nov 12, 2009, at 3:22 PM, 4d_tech-request@... wrote:

> Mark,
>
> The easiest way I've found is to use the GRAPH command (page 681), but declare the graphArea as a C_Picture(graphArea).
>
> Then with the 4D SVG Component you can use this if you need the XML text:
>
> $svgRef:=SVG_Open_picture (graphArea)
> $text:=SVG_Export_to_XML ($svgRef)
>
> Keith
> Computer Dimensions, Inc.
> 409-866-8378

**********************************************************************
Get up to $600 to spend on Amazon.com
this holiday season - http://www.4d.com/serverpromo.html


4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4D.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4D_Tech-Unsubscribe@...
**********************************************************************

Parent Message unknown Re: SVG Charts

by Keith Culotta :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello Mark,

Yes, it seems like a quick way to get some of the work done building the XML document.

Keith
Computer Dimensions, Inc.

On Nov 13, 2009, at 8:47 AM, 4d_tech-request@... wrote:

> Are you suggesting that I use SVG_Export_to_XML in order to get at the xml source and customize it on the fly (remove legend, y-axis labels, etc.).  Then, export it back to picture?

**********************************************************************
Get up to $600 to spend on Amazon.com
this holiday season - http://www.4d.com/serverpromo.html


4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4D.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4D_Tech-Unsubscribe@...
**********************************************************************

Parent Message unknown Re: SVG Charts

by Mark Scardigno :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks, Tom.  I am leaning toward #1.  However, the GRAPH command is nice in that it handles the calculating of everything automatically.

On Nov 12, 2009, at 4:31 PM, 4d_tech-request@... wrote:

> Hi Mark,
>
>> 1) 4D SVG Component
>> 2) Creating the SVG XML on the fly
>> 3) Store an SVG XML template and use PROCESS HTML TAGS to customize the
>> chart on the fly
>
> Although perhaps the easiest way to handle this is with the GRAPH command it
> definitely does not give you the most control. I would suggest that you use
> #1 or #3. The 4D SVG Component is really just creating and editing XML at an
> abstracted (and easier to understand and manipulate) level.
>
> I am most familiar with using the SVG Component to build your SVG on the
> fly. Each time you scroll through the arealist rows that chart will change
> and you will rebuild your SVG. Depending on the number of elements in the
> SVG image it is usually very fast. In the charts I have built it is fast
> enough to recreate the SVG on resize (as you drag the window) so I would
> assume it is fast enough for scrolling through list items.
>
> Kind Regards,
>
> Tom Fitch
> Technical Services Team Member
> 4D, Inc.

**********************************************************************
Get up to $600 to spend on Amazon.com
this holiday season - http://www.4d.com/serverpromo.html


4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4D.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4D_Tech-Unsubscribe@...
**********************************************************************