]>
The goal of this demo is to show some of the {svggraph_library} features, and to help reduce the learning curve to get you started with creating your own SVG Graphs.
SVG (Scalable Vector Graphics) is a widely-deployed royalty-free graphics format developed and maintained by the W3C SVG Working Group.
The {state_summary} sample that comes with Forena, includes an SVG graph (near the top). It's named the state graph and comes with a set of predefined graph generation options, such as colors (green and yellow), graph type (bargraph), data selection criteria (total at least 10000), etc. This included state graph is actually another sample that comes with forena, though it is hidden (using a forena option to do so) in the list of sample reports. Checkout this {state_graph} link to see it anyhow. As a variation, remove the hidden='true' tag in its frx member and see what happens.
Even though forena does an amazing job in creating SVG graphs, it is not (yet) obvious to get started with creating your own forena based SVG Graphs. And this because, as delivered, the state graph:
That's why this SVG Graph Demo was created ... enjoy reviewing it!
To get started, how about this (vertical) BarGraph (in 3D, so it is actually Bar3DGraph) with like 20 different colors: |
Here is a sample of a CylinderGraph with way less colors as compared to the BarGraph before: |
Let's find out what a LineGraph would look like, using green triangles as markers, the line that connects the markers should be a blue dashed line (dashes of 3 pixels combined with 3 pixels of gap), and the area under the line should be filled in red, using 25% opacity for that filled area: |
Here is the ScatterGraph variation, using purple diamonds as markers, and with an extra best fit line added to it to draw a straight (red) line through the data points (using 7 pixels dashes combined with 7 pixels of gap). Let's also zoom into the more interesting part of all the data included in the graph, i.e. start the Y-axis only from 7000, and increment the Y-axis values with 1000 (to get more detailed Y-axis data starting from 7000): |
Let's change to a PieGraph (also in 3D, so it is actually Pie3DGraph). And let's use lots of colors (purple, cyan, red, blue, gold, green, indigo, orange, brown, pink, ...): |
Here is a sample of a RadarGraph (same data as the previous chart, only the graph type is different), using red triangles as markers, the line that connects the markers should be a purple dashed line (dashes of 3 pixels combined with 3 pixels of gap), and the area within the line should be filled in green, using 40% opacity for that filled area: |
Let's return to a BarGraph (with horizontal bars, actually a HorizontalBarGraph). Let's only show states with a total nr of users of at least 12000 (instead of 10000) and we need to swap the labels also. This horizontal BarGraph looks rather ugly, no? The data labels below the chart have become unreadable, even enlarging the width of the graph a bit won't really help (too much data-labels to be shown). |
By applying some advanced SVG Graph features it is possible to enhance the previous graph to something that looks already much better (still not perfect, but much better already, no?) ... |
By the way, in case you haven't noticed yet: all graphs above also includes drill-down links. Just click on any of the colored items in any of the charts, and see what the result of doing so is!
As a reminder: this is just an introduction to create SVG Graphs. We haven't even mentioned some of the additional features, such as:
So what do you think after this first SVG Graph Introduction, pretty impressive already, no? If you like what you've seen above, and want to take all this a step further, you should consider checking out all those SVG Graph options available, your creativity is about your only limitation. That's where the fun with SVG Graphs really starts.