Saturday, 23 July 2011
Simple Encoding Format
Simple encoding format lets you specify integer values from 0—61, inclusive, encoded by a single alphanumeric character. This results in the shortest data string URL of all the data formats. However, if you have a line or bar chart that is longer than 100 pixels along the data axis, you might want to use another format. This is because, with only 62 data values supported, the data granularity is much bigger than the display granularity, and values will be just little off (not much, but visible on larger charts).
Note that if you use the
chds
parameter with simple encoding, data element size on the chart won't be affected, but any data point marker values will be.Syntax:
chd=s:<series_1>,...,<series_n>
- <series_1>
- A string, where each character is a single data point, and series are delimited by a comma. Individual values within a series are not delimited. Here are the supported data characters, and their corresponding values:
A—Z
, whereA
= 0,B
= 1, and so on, toZ
= 25a—z
, wherea
= 26,b
= 27, and so on, toz
= 510(zero)—9
, where0
= 52 and9
= 61- The underscore character (
_
) indicates a missing value
You can use the following tool to encode a single value, or the JavaScript code to scale and encode an entire URL string.
Plain Text | Encoded Text |
Example:
Equivalent to the text-encoded string chd=t:1,19,27,53,61,-1|12,39,57,45,51,27 | chd=s:BTb19_,Mn5tzb |