ZingChart tips & tricks - Removing Graphset
Commonly, a ZingChart JSON packet is formatted to include a graphset
to allow for a trellis of charts. However, if you have only one graph, then it's really not needed.
Removing graphset code
For example, a simple line might be written as:
{
"graphset" : [
{
"type" : "line",
"series" : [
{
"values" : [11,26,7,44,11,28,42,26,13,32,12,4,21,11,43,39]
}]
}]
}
However it can be simplified to:
{
"type" : "line",
"series" : [
{
"values" : [11,26,7,44,11,28,42,26,13,32,12,4,21,11,43,39]
}]
}
This simple tip saves a few bytes, reduces nesting complexity, and works with both Flash and HTML5 versions of ZingChart.