Sparkline Charts
Sure there are lots of sparkline utilities out there, but wouldn't it be great if Highcharts had them too?
Creating a sparkline in Highcharts is possible by removing all axes, labels etc. The following demo shows how to create a custom constructor with all labels stripped:
-
There are a lot of ways to handle data dynamically in Highcharts. You will use methods like Series.addPoint, Point.update etc. You'll find all those documented at http://api.highcharts.com.
-
Anonymous commented
The Highcharts SparkLine demo has only the static data. But I need to populate the chart with dynamic data by clicking a button. How can I achieve this behaviour? I read in the demo code something like $(element).highcharts('SparkLine'). Is it something related to dynamic rendering? If so, how can I use this?
-
@Anonymous: The link in the status posted to a simple demo. The http://www.highcharts.com/demo/sparkline sample shows a more relevant use case.
-
Anonymous commented
There are some features which makes sense only for sparkline charts and small sense for big ones. (Or just one example is not enough to show all is possible in sparkling charts)
-
Anonymous commented
Unfortunately it is wishful thinking that it just removed labels
-
Yes of course. The sparkline demo is just regular charts with labels removed.
-
Anonymous commented
Does the sparkline chart support scatter plots too?
-
Sparklines are just regular charts with all labels removed - I'll see if I can get a sample made as soon as possible, it's a pity that people think this is not supported by Highcharts. We should have a sparkline sample in our demo collection.
-
laurie commented
Hi Torstein - is this still under review? There are so many modern web apps using them now (and we want to keep up) it would be great not to have to use two charting libraries.
-
Bill commented
I've been playing around with that code example, and have gotten close to what I'm looking for. http://jsfiddle.net/dWgYS/73/
Anyone know how to get rid of the large spaces on either side of the sparkline? None of the margin options seem to work. -
Jamie commented
can be done easily enough: http://jsfiddle.net/DUfcR/1/