News for hackers. Stuff that matters.
Re:New Chart.js beta version launched by blhack on Sunday June 29, 2014 @07:57PM (#7962992)
It looks like this version includes a chart legend for pie/doughnut charts! Unless I am very mistaken, the old version, which I am using in my latest product, did not :(.

Hooray chartjs people, I love your product :) -- it is definitely my favorite charting library :).

BTW, does anybody know of a charting library that will make nice 1D scatter plots? (Like this: http://i.stack.imgur.com/LGBAG.png).

These are very useful visualizations for event frequency, but I can't find any libraries that make them.

Re:New Chart.js beta version launched by minikomi on Sunday June 29, 2014 @09:16PM (#7963186)
Do you have any examples of how you'd like them to look in the browser? It shouldn't be hard to throw something together with d3 which simply takes an array.

edit: quick example. http://jsfiddle.net/R532h/

Re:New Chart.js beta version launched by dzderic on Sunday June 29, 2014 @08:58PM (#7963147)
You should be able to recreate that 1D scatter plot using a regular scatter plot and setting all of the y values to 0 (unless I'm missing something).
Re:New Chart.js beta version launched by capkutay on Sunday June 29, 2014 @05:18PM (#7962448)
Would someone who's familiar with chart.js do a quick comparison between other popular charting libraries? I've mostly used rickshaw and d3.
Re:New Chart.js beta version launched by Throwaway0812 on Sunday June 29, 2014 @05:51PM (#7962595)
Don't forget Highcharts...

http://www.highcharts.com

Re:New Chart.js beta version launched by cglee on Sunday June 29, 2014 @07:04PM (#7962840)
Just from a cursory glance, it appears that Chartjs is entirely free and you can do what you want with it, while Highcharts is not.
Re:New Chart.js beta version launched by hayksaakian on Sunday June 29, 2014 @10:43PM (#7963431)
It would be nice if this distinction was stated unambiguously on the front page

here's the license if you were looking for it like I was

https://github.com/nnnick/Chart.js/blob/master/LICENSE.md

Re:New Chart.js beta version launched by eterm on Monday June 30, 2014 @05:00AM (#7964254)
Took me ages to find the license, I ended up clicking documentation and still having to search for the word license to find it. I wish it was more prominent on the landing page.
Re:New Chart.js beta version launched by skeletonjelly on Monday June 30, 2014 @06:35AM (#7964416)
Highcharts is free for non commercial
Re:New Chart.js beta version launched by paul_f on Sunday June 29, 2014 @08:25PM (#7963071)
Big fan of Highcharts. Like that you can export charts to a png. Big deal for me, don't think chart.js offers anything like that?
Re:New Chart.js beta version launched by lalwanivikas on Monday June 30, 2014 @02:02AM (#7963881)
FusionCharts can export charts to PNG, JPG, PDF and SVG. I've been trying both FusionCharts and HighCharts for past few weeks and I can say that I am a bit inclined towards FusionCharts. Had this discussion the other day as well when Epoch[1] was released.

[1] https://news.ycombinator.com/item?id=7948560

Re:New Chart.js beta version launched by nnnnnick on Monday June 30, 2014 @05:17AM (#7964280)
Yep, you can call .toBase64Image() on your chart instance to return a png image encoded as a base 64 data url.
Re:New Chart.js beta version launched by scrollaway on Sunday June 29, 2014 @06:16PM (#7962696)
I really like the feel of HighCharts. I've been using HighStock (their financial charts) for traffic analytics graphs and it works really well.
Re:New Chart.js beta version launched by lalwanivikas on Monday June 30, 2014 @01:47AM (#7963827)
Re:New Chart.js beta version launched by ceejayoz on Monday June 30, 2014 @07:11PM (#7968249)
Surely this is going to be prone to bias, even if it's only subconscious?
Re:New Chart.js beta version launched by lalwanivikas on Tuesday July 01, 2014 @12:58AM (#7969212)
It can be. Therefore it's best to take it with a pinch of salt and decide for yourself. Different requirements will demand for different products. I've seen big enterprises going only for FusionCharts whereas individual developers tend to go for other options like HighCharts. But I took FusionCharts for my personal projects because it was free it had a huge library.
Re:New Chart.js beta version launched by nailer on Monday June 30, 2014 @04:41PM (#7967565)
Oh it's got highcharts too. Thanks.
Re:New Chart.js beta version launched by freditup on Sunday June 29, 2014 @07:55PM (#7962985)
I haven't used d3 but I used chart.js a little while ago. At the time is was relatively simple but lacking some features (like support for interactions). Looks like this newest version has added some of that which is great. My guess is that it's still lighter-weight & simpler than d3 which makes it good for some use cases but not others.

Edit: I've only had good experiences with chart.js (not sure if that was clear)

Re:New Chart.js beta version launched by stephenitis on Monday June 30, 2014 @03:45AM (#7964127)
Re:New Chart.js beta version launched by Flip-per on Monday June 30, 2014 @08:39AM (#7964721)
I just gave it a try. It's nice and easy to use, but I need to draw a legend which it surprisingly doesn't seem to support, so I won't use it. Otherwise it'd have been a good match for my simple purposes (non-scaled, non-animated, non-interactive).

BTW, "options.pointDot = false" doesn't seem to have any effect. "options.pointDotRadius = 0" worked for me.

Re:New Chart.js beta version launched by ceejayoz on Monday June 30, 2014 @08:40AM (#7964723)
The "modular" section of the page appears to show a legend.
Re:New Chart.js beta version launched by Flip-per on Monday June 30, 2014 @09:21AM (#7964878)
True, but for line charts the labels are just used for the tooltips, not for any legend. For the old charts.js version there is a legend-extension on github (https://github.com/bebraw/Chart.js.legend) which I didn't try because I didn't think it'd be compatible with the current beta-release (I might be wrong).
Re:New Chart.js beta version launched by piratebroadcast on Sunday June 29, 2014 @09:14PM (#7963177)
At work, we use Google Charts to chart data, then send images of those charts to users via email, inline. We are told that this functionality will be deprecated in the API some time next year. Anyone have an idea of how to mitigate that? Emails dont support javascript so not sure how to get around this. Just for some clarity, if you happen to use Sendgrid, they do the same thing. Google chart images in an email.
Re:New Chart.js beta version launched by e1g on Monday June 30, 2014 @05:18AM (#7964283)
Google Charts are rendered through SVG, and fortunately you have two options to reliably convert any SVG to PNG. One options is "Batik Rasterizer"[1] - it is a single .jar file, fast, and accurately renders 99% of our cases. The other options is Wkhtmltopdf[2] - it comes with a companion wkhtmltoimage binary which convert SVG to PNG through a customised webkit engine. It also is fast, and can handle our most complex visualisations.

All we do is grab the SVG source with JS, post it back to the server, and get the image back (after it is scaled/watermarked/optimised). This setup has worked well for us for some years now. Further we can easily interchange charting libraries with on concern about their native exporting options because we handle the rendering ourselves.

[1] https://xmlgraphics.apache.org/batik/tools/rasterizer.html

[2] http://wkhtmltopdf.org/

Re:New Chart.js beta version launched by ricree on Sunday June 29, 2014 @11:39PM (#7963588)
If you're ok with hosting the images yourself, I'd recommend matplotlib (http://matplotlib.org/ ) as a pretty good chart library.
Re:New Chart.js beta version launched by maxmcd on Sunday June 29, 2014 @09:36PM (#7963246)
Something that involves this possibly? http://www.paulhammond.org/webkit2png/

Might be overkill, but would allow quite a bit of flexibility.

Re:New Chart.js beta version launched by ninjay on Sunday June 29, 2014 @09:39PM (#7963251)
The general idea is to render the chart in a headless browser and grab a screenshot.

http://phantomjs.org/screen-capture.html

Re:New Chart.js beta version launched by brok3nmachine on Monday June 30, 2014 @07:09AM (#7964483)
I recently spent about 20 minutes setting up c3 (http://c3js.org/) for a commercial product I'm developing. Great library, but its footprint is fairly hefty. Looking forward to giving this a try, if it is just as quick to implement.
Re:New Chart.js beta version launched by ak39 on Sunday June 29, 2014 @07:28PM (#7962918)
Hi Nick,

Is Chartjs related to Chartjs from DevExpress?

Edit: Link http://js.devexpress.com/Documentation/Howto/Data_Visualizat...

Re:New Chart.js beta version launched by LX-350 on Tuesday July 01, 2014 @03:54AM (#7969594)
It is not. Currently using DevExpress at work. They've actually re-branded it as DevExtreme with their latest release (v14.1).
Re:New Chart.js beta version launched by bnycum on Sunday June 29, 2014 @04:31PM (#7962287)
I like Chart.js, I can't tell if I'm looking at the beta from my phone though. I'd hope they add a scatter plot then it'd be close to perfect. There might be a fork I haven't found yet, but I know anything I made wouldn't look as nice.
Re:New Chart.js beta version launched by nnnnnick on Sunday June 29, 2014 @04:49PM (#7962349)
New site is responsive for mobile, so you should be seeing the new version!

This new release allows for custom chart types, using the same core API, so hopefully we'll see some community led new chart type extensions soon!

Re:New Chart.js beta version launched by bnycum on Sunday June 29, 2014 @11:20PM (#7963531)
Thanks! I'll see if I can give it a shot, I just went back after grabbing my laptop and noticed the section on writing new chart types. Maybe I can figure it out. I have a project in mind I could use this for.
Re:New Chart.js beta version launched by knes on Sunday June 29, 2014 @06:25PM (#7962724)
Looking foward to use the new beta through angles (https://github.com/lgsilver/angles) the Angular wrapper for chartjs.
Re:New Chart.js beta version launched by wingerlang on Monday June 30, 2014 @03:30AM (#7964100)
Neat, I was looking over lots of different charting libraries the other day and this looks great. And it is free to use in commercial projects which, hopefully, will be relevant for me in the future!
Re:New Chart.js beta version launched by JelteF on Monday June 30, 2014 @06:55AM (#7964448)
Check out this one as well: https://morrisjs.github.io/morris.js/
Re:New Chart.js beta version launched by SakiWatanabe on Monday June 30, 2014 @01:41AM (#7963819)
Is there any free(for commercial use) candlestick charts available?
Re:New Chart.js beta version launched by andyhmltn on Monday June 30, 2014 @04:14AM (#7964171)
I've used Chart.JS for quite a few big projects but I always found it lacking in some crucial features (hover/tap events & legends)
Re:New Chart.js beta version launched by lalwanivikas on Monday June 30, 2014 @05:07AM (#7964266)
andyhmltn, try FusionCharts or HighCharts instead. I have had good experience with FusionCharts till now and it also has the features(hover/tap events & legends) that you are looking for. Feel free to mail me if you get stuck somewhere. Can't say much about HighCharts as I am yet to experiment with all its features. But everyone here seems to love them, so you can find good support for it as well.
Re:New Chart.js beta version launched by eweise on Sunday June 29, 2014 @06:54PM (#7962817)
Can the data in the charts be updated in realtime? I'm looking for graphs to display operations type data like cpu usage, etc over time.
Re:New Chart.js beta version launched by Rodeva on Sunday June 29, 2014 @07:47PM (#7962960)
Each one of the chart types has a prototype method .update() which will re-draw the chart with your updated values, so real-time updates are possible.

[1] http://www.chartjs.org/docs/

Re:New Chart.js beta version launched by kamicut on Sunday June 29, 2014 @09:56PM (#7963301)
Re:New Chart.js beta version launched by hackerews on Sunday June 29, 2014 @06:33PM (#7962744)
Nick this is awesome. Would love to feature your work on blockspring.com so non-engineers can use chart.js graphs directly.
Re:New Chart.js beta version launched by loganu on Sunday June 29, 2014 @07:29PM (#7962921)
Blockspring looks like a great resource. Free to use? Spits out code to paste into html? Nick, Charts looks awesome and might make its way into my next project.
Re:New Chart.js beta version launched by nnnnnick on Sunday June 29, 2014 @06:51PM (#7962805)
Sounds ace, let me know if there's anything I can do to help!
Re:New Chart.js beta version launched by fredsted on Monday June 30, 2014 @08:33AM (#7964703)
Finally hover tooltips for bar graphs! A pretty important feature Chart.js was lacking before in my opinion.
Re:New Chart.js beta version launched by ergo14 on Monday June 30, 2014 @06:20AM (#7964385)
I've used rickshaw and nvd3 - chart.js seems pretty minimal compared to them.
Re:New Chart.js beta version launched by samdb on Monday June 30, 2014 @06:42AM (#7964431)
We tried NVD3 when we built http://www.chartblocks.com as it would have saved us loads of time. It wasn't great though and had almost no flexibility.
Re:New Chart.js beta version launched by cpeterso on Monday June 30, 2014 @12:23PM (#7965892)
If NVD3 didn't work out for you, what did charting library did you choose instead?
Re:New Chart.js beta version launched by dewey on Sunday June 29, 2014 @05:02PM (#7962393)
Interactive mode for tooltips. That's great news, very excited about that!
Re:New Chart.js beta version launched by jbrooksuk on Sunday June 29, 2014 @05:30PM (#7962493)
Awesome! We've been waiting for this for some time - nice release Nick!
Re:New Chart.js beta version launched by nnnnnick on Sunday June 29, 2014 @05:43PM (#7962556)
Cheers, sorry it took so long!
Re:New Chart.js beta version launched by bricss on Sunday June 29, 2014 @04:47PM (#7962342)
You've made my day! Thx!
Re:New Chart.js beta version launched by georgewfraser on Sunday June 29, 2014 @05:47PM (#7962577)
Why canvas instead of svg?
Re:New Chart.js beta version launched by nnnnnick on Sunday June 29, 2014 @06:07PM (#7962657)
SVG is a good solution too, but it can really suffer performance-wise, especially on mobile, tablet and when animating svg node positions.
Re:New Chart.js beta version launched by petilon on Sunday June 29, 2014 @09:33PM (#7963238)
Canvas is bitmap-based, while SVG is vector. If you need to print the chart SVG is going to look a lot better. Also, if you pinch-zoom the chart, SVG is going to look better. Canvas doesn't support animation -- you have to code it yourself. SVG performance is quite good unless you have thousands of elements, which a chart isn't going to have.
Re:New Chart.js beta version launched by Kiro on Monday June 30, 2014 @04:25AM (#7964194)
> Canvas doesn't support animation -- you have to code it yourself.

What do you mean?

Re:New Chart.js beta version launched by coldtea on Monday June 30, 2014 @05:17AM (#7964281)
The obvious. That canvas is just a set of pixels with colors (a bitmap image). To get animation, you have to explicitly change them every X milliseconds.

Whereas SVG has actual objects, that you can apply items like animateTransform, animateMotion etc to them directly, in a declarative style.

Re:New Chart.js beta version launched by Kiro on Monday June 30, 2014 @05:41AM (#7964326)
Ok, thanks. I didn't know that. I thought you had to clear/redraw the SVG for animation as well.
Re:New Chart.js beta version launched by bicknergseng on Sunday June 29, 2014 @06:32PM (#7962739)
Have you done any benchmarking of canvas vs svg charts?
Re:New Chart.js beta version launched by nnnnnick on Sunday June 29, 2014 @06:49PM (#7962799)
I did a while back for my university dissertation, I'll have to see if I can dig it out.

IIRC: canvas tends to outperform svg when dealing with a lot of individual objects, due to them being individual dom nodes in svg. However svg will outperform canvas drawing fewer nodes, on a larger canvas, due to canvas being bitmap based.

Re:New Chart.js beta version launched by maxmcd on Sunday June 29, 2014 @06:31PM (#7962737)
Homepage grid breaks at 1440px wide for me (Chrome/osx).

Great update, love the tooltips.