javascript - flot charting with jsreport and epoch time on xasis -
i trying leverage jsreport generate simple pdf report contains graph of bpsin on time range. data static, have run issues few items:
(1) when attempt leverage moment.js format data, moment.unix({{this.[1]}}*1000)
seems work fine, however, when add .format("yyyy-mm-dd")
on end format epoch time human readable, content disappears graph.
i have playground version setup on jsreport's playground illustrates graph working bar chart epoch timestamps. notice how they're unreadable..
converting line chart simple. i've tried replacing mode: "categories"
within xasis
of flot use time, as:
xaxis: { mode: "time", minticksize: [15, "minute"], min: (new date(data.points[0][1])).gettime(), max: (new date(data.points[0][29])).gettime(), timeformat: "%y/%m/%d" }, "lines": {"show": "true"}, "points": {"show": "true"}, clickable:true, hoverable: true
with appropriate additional includes: //cdnjs.cloudflare.com/ajax/libs/flot/0.8.3/jquery.flot.min.js
//cdnjs.cloudflare.com/ajax/libs/flot/0.8.3/jquery.flot.categories.min.js
//cdnjs.cloudflare.com/ajax/libs/flot/0.8.3/jquery.flot.time.min.js
//cdnjs.cloudflare.com/ajax/libs/flot/0.8.3/jquery.flot.symbol.min.js
the end goal have report human readable dates xasis, dates 15minute increments data coming influxdb @ moment test data.
i ended answering own question upon adding comment question flot wanting time in utc (facepalm).
Comments
Post a Comment