jondot/graphene

TimeSeries chart for JSON data

Opened this issue · 4 comments

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 ?

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:

#39

Thanks

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

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!

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