graphite-project/graphite-web — pull request #980 by toni-moreno (2014-10-02 09:11:42+00:00)
Title: added subformat XmsY to json format al

added subformat XmsY to json format allowing client side apps based on javascript accelerate data import

As I proposed in https://github.com/graphite-project/graphite-web/issues/976

I've added a new subformat parameter with format XmsY , when you query data with this new parameter server will return series datapoints in a more suitable javascript format

X= time
Y=value
[ X in timestamps in ms , Y]

So if you do a query

```
http:///render?format=json&from=-6h&until=now&target=aliasByNode(dwily.pro.c1.s1.nono.system.disk.sda.disk_octets.read,7)
```
you will get that.

![image](https://cloud.githubusercontent.com/assets/5883405/4488744/d9b78f20-4a11-11e4-88ea-e0a27a32f7c3.png)

else if you do this other query

```
http:///render?format=json&subformat=XmsY&from=-6h&until=now&target=aliasByNode(dwily.pro.c1.s1.nono.system.disk.sda.disk_octets.read,7)
```
![image](https://cloud.githubusercontent.com/assets/5883405/4488777/3d834e4a-4a12-11e4-986e-9228294b3a98.png)

Now client side can support querys with this format and check if returned serie[i].format='XmsY'

a) if returned, the graphite server support new subformat parameter and can get data direct from retured json data. without need of reorder and transform X value.

b) else, the server side is not yet supporting subformat parameter an server will return data in the old format "YXs" ( default if no parameter subformat is queried) and client side will have to reorder and transform data.