






























Questions? Email us:
sales@haneng.com
|
|
Optional Compact Parameters
The standard way of writing parameters for HanengCharts is also the best way
for most charts. But when working with large amounts of data the amount of HTML
code needed can grow very big and add several Kb to the file size of the hosting page.
With Compact Parameters we offer an optional way of writing parameters that is more compact
and efficient.
Lets start with an example:
The left chart is created using the standard way of writing parameters:
<APPLET CODE="HanengCharts.class" ARCHIVE="HanengCharts3.jar" WIDTH=400 HEIGHT=350>
<PARAM NAME="LicenseKey" VALUE="30DAYDEMO-JQ86Q6FUvKQ16K">
<PARAM NAME="ChartType" VALUE="3DLayeredBar">
<PARAM NAME="Value_a_1" VALUE="10">
<PARAM NAME="Value_a_2" VALUE="20">
<PARAM NAME="Value_a_3" VALUE="30">
<PARAM NAME="Value_a_4" VALUE="40">
<PARAM NAME="Value_b_1" VALUE="30">
<PARAM NAME="Value_b_2" VALUE="10">
<PARAM NAME="Value_b_3" VALUE="20">
<PARAM NAME="Value_b_4" VALUE="10">
</APPLET>
But the right chart is created using the optional compact method:
<APPLET CODE="HanengCharts.class" ARCHIVE="HanengCharts3.jar" WIDTH=400 HEIGHT=350>
<PARAM NAME="LicenseKey" VALUE="30DAYDEMO-JQ86Q6FUvKQ16K">
<PARAM NAME="ChartType" VALUE="3DLayeredBar">
<PARAM NAME="Values_a" VALUE="10|20|30|40">
<PARAM NAME="Values_b" VALUE="30|10|20|10">
</APPLET>
As you can see the code for the second chart is much more compact. But how was it done?
Instead of writing each value as a separat PARAM tag
we use a special PARAM tag named Values_a
(note the S in Values) and then list the values separated by a "|" character.
For non multi charts the parameter is called Values:
<PARAM NAME="Values" VALUE="10|20|30|40">
The difference in size might not seam that big, but if you are plotting hundreds or even thousands
of values you can save several Kb. We have created an example to showcase this.
Both pages contain the same chart with 1000 values:
Page A page size 40Kb
Page B page size 5Kb (uses compact code)
Not Only Values
There are compact versions of most parameters:
<PARAM NAME="Texts" VALUE="Text1|Text2|Text3|Text4">
<PARAM NAME="Colors" VALUE="ff0000|00ffff|ffff00|ff00ff">
<PARAM NAME="Colors_a" VALUE="ff0000|00ffff|ffff00|ff00ff">
<PARAM NAME="Labels" VALUE="Label1|Label2|Label3|Label4">
<PARAM NAME="Labels_a" VALUE="Label a1|Label a2|Label a3|Label a4">
<PARAM NAME="Links" VALUE="http://www.google.com/|http://www.google.com/|http://www.google.com/|http://www.google.com/">
<PARAM NAME="Links_a" VALUE="http://www.google.com/|http://www.google.com/|http://www.google.com/|http://www.google.com/">
<PARAM NAME="Targets" VALUE="_blank|_blank|_blank|_blank">
<PARAM NAME="Targets_a" VALUE="_blank|_blank|_blank|_blank">
Note that you can NOT combine compact parameters and standard parameters in the same
chart. So you can't have
<PARAM NAME="Texts" VALUE="Text1|Text2|Text3|Text4">
and
<PARAM NAME="Value_1" VALUE="20">
in the same chart.
Back >>
|
|