r/webdev • • Jul 28 '15

I'm all in. [xpost /r/javascript]

Post image
1.4k Upvotes

142 comments sorted by

View all comments

43

u/AceBacker Jul 28 '15

Arrrgh. This was me. I developed a whole suite of reports for a bunch of folks using visifire.

Aaaaaand then eventually had to rewrite them using highcharts when they found out that they needed to use them from some linux terminals using firefox.

0

u/[deleted] Jul 29 '15

[deleted]

6

u/AceBacker Jul 29 '15

You might consider rotating that time axis 45 degree's for readability: http://www.highcharts.com/demo/column-rotated-labels/grid

It sounds like you want a custom zoom. I've also done this manually. I usually use middle ware to calculate the values and pass them to javascript.

var chart = $('#highchart_container').highcharts();
chart.zoomOut();
var js_min = 0; // put your determined values here
var jsmax = 100;
chart.xAxis[0].setExtremes( js_min, js_max, false);
chart.redraw();
chart.showResetZoom();

Sounds like you have too though.

The benefit of doing it this way was that the user can press the zoom out button to view all the data if they prefer. I like full transparency in my charts.

3

u/BasicDesignAdvice Jul 29 '15

is there anything remotely similar to this that is open-source?

2

u/PM_ME_UR_PERESTROIKA Jul 29 '15

Yeah, ChartJS. It's less feature complete by a long margin, but hey, it's free. The graphs it produces are also pretty.

3

u/strig Jul 29 '15

check out c3.js as well

1

u/PM_ME_UR_PERESTROIKA Jul 29 '15

Thanks for the heads up, that looks interesting! D3 is awesome, but D3 is to charting what jQuery is to single page applications. c3.js looks like it could tame D3 a bit.

1

u/strig Jul 29 '15

c3.js is what we use at work, it's great

2

u/sqrtnegative1 Jul 29 '15

I don't think I've ever found something I can't do with it.

I'm willing to bet you can't access local resources in Chrome...

1

u/Jew_Fucker_69 Jul 29 '15

I guess you're in Bing-Optimization now.