jondot / graphene

Graphene is a realtime dashboard & graphing toolkit based on D3 and Backbone.
http://jondot.github.com/graphene
2.87k stars 231 forks source link

TimeSeries chart for JSON data #54

Open eeshamca opened 11 years ago

eeshamca commented 11 years ago

Hi, I am creating chart for TimeSeries Data, I have done code for getting JSON output as below. ([{ "first": "12.35", "second": "34.5", "third": "04.34"}]) But this output will not prepare a chart of TimeSeries in Graphene. Is it worked for PHP coding ? My code was written in PHP and made json_encode and call the GET request to PHP file and get the response as JSON data as above mentioned. If it works for PHP, then How to pass these data to Graphene chart and how it could be possible to make changes dynamically ?

jondot commented 11 years ago

Hi, Graphene works best with Graphite, but if you are not using Graphite and want to use Graphene, it is still possible to build a server-side endpoint that mimics how Graphite exposes data. I advise to take a look at the discussion here:

https://github.com/jondot/graphene/issues/39

Thanks

jondot commented 11 years ago

@eeshamca hey there - did it work out for you eventually? anything I can help out with?

danielme85 commented 10 years ago

hey @jondot, I´m trying to accomplish the same as @eeshamca is talking about. I need to fake the Graphite structure based on some Apple plist xml data.
have a url delivering the following json data: [{"target":"name","datapoints":[[1406801041,341],[1406800983,399]]}] The object is built and i get a: "Starting to poll at * " console message, but nothings happening. It works with the g.demo() hook enabled.

Thanks!

danielme85 commented 10 years ago

I got it working, the json data needed to be wrapped in a jsonp callback request from Graphene. I use php on the server that handles the request, if you happen to be in the same situation i found the solution here: http://www.geekality.net/2010/06/27/php-how-to-easily-provide-json-and-jsonp/ $json = json_encode($output); echo isset($_GET['jsonp']) ? "{$_GET['jsonp']}($json)" : $json;

Got some fancy graphs now, nice work @jondot