Appropriate JSON data format

144 views
Skip to first unread message

Tony Green

unread,
Aug 6, 2014, 9:40:09 PM8/6/14
to flo...@googlegroups.com
Hi,
I want to build and pass my .NET data objects to the Flotr2 Draw() function.  What is the appropriate JSON format to get the data into in order for Flotr2 to work?  I've tried various versions but can't seem to find the right one.  I would like to be able to label each value as the default behavior of LINQ in .NET.

var chart = [
   
{
       
"data": [
//            {"a":34, "b":1000}, {"a":34, "b":1100}, {"a":38, "b":1200}
//            [34, 1000], [36, 1100], [38, 1200]
           
{[{34, 1000}], [{36, 1100}], [{38, 1200}]}
     
],
   
"label": "Series3"
   
}
];


Ørjan Pettersen

unread,
Oct 7, 2014, 6:16:31 AM10/7/14
to flo...@googlegroups.com
With only one data series, what works for me is

var chart = [[[34, 1000], [36, 1100], [38, 1200]]];

Flotr.draw(container, chart,..);

-Ørjan-
Reply all
Reply to author
Forward
0 new messages