I'm using the wonderful Highcharts, and I was wondering if there was a config option to change the data periodicity of a time series.
Like the chart on this page - letting you switch from monthly to quarterly to yearly intervals.
I can add client-side code to do it if not, but since Highcharts is so powerful, I just wondered if it was a built-in option.
I can't see anything in the docs, but I'm not sure if "periodicity" is the right word for what I need!
Here's the answer (found via #SebastianBochan).
You have to use Highstock for an inbuilt option. Highstock documentation here.
Otherwise you can roll your own interactions to calculate new data groupings and then call setData to set the new data.
Related
I've been looking all over but not found any answers for this.
So a bit of background. I've created an in-house analytics system for the company I work for off the back of highcharts. The analytics data is pulled from a nosql database via elasticsearch queries. The returned information is converted into formats suitable for different highcharts graphs. The range and interval of the data is user defined and plumbed into the query, manipulating that query behind the scenes to say "now-1d" to "now" or "now-1w" etc for the range of data required.
So i'm trying to add a flag series to my system. The flags are based on a number of comments pulled from the same database. The problem is that, whilst I can remove the flag series from the main legend area, the older flags expand the graph out of recognition (Example Image)
The range of the data is user defined, like I said, but in a different format to one supported in javascript. This means I cant just force the min and max of the x-axis.... because I don't know (or even care) about what they are in my system.
Im wondering if there is any way to force a specific series to not scale the x-axis of the graph and be ignored in that regard.
Thanks
Recently I got a requirement where
I have a certain amount of time series data, I need to show the data on a chart on a web page.
(I know this can be done easily since there is Highcharts, Google charts, etc)
However, a more complicated feature request came up. I need to be able to annotate one or more data points on the chart, and annotate them as - say Test Run 1, and maybe another series of data points at Test Run 2. (You can think of it as maybe someone is playing around with a hardware, the first time he collected a set of data, and the second time he collected another a set of data. I want to be able to annotate and diffenrentiate those data sets on the chart)
I will need to preserve those segmentations/groupings and save them in a persistent store, so that next time I load the chart, I can show those grouping again on the chart.
Does anyone know what is the best way to do this? Or are there existing features of any Javascript UI framework that's already capable of doing it?
Thanks so much.
So basically I'm using the Highcharts JavaScript library to render a very simple line graph to my HTML5 page. The chart represents the volume of tweets I've crawled from Twitter.
So my question is for anyone who has a fair idea of what Highcharts is capable of. I know you're able to highlight a section of the chart and have it zoom in. Is it possible to have the chart recognize the start and end time I've highlighted and give it back to me.
I wanna be able to query my database and pull out all the tweets between the two times and render them to the page. Anyone any idea if that's feasible?
Yes it is possible, you can achieve it by catching afterSetExtremes function.
http://jsfiddle.net/JzEnV/
events:{
afterSetExtremes:function(){
alert(this.min);
alert(this.max);
}
}
If you would like to get dates, then you can use dateFormat()
http://api.highcharts.com/highcharts#Highcharts.dateFormat()
Here's an example: I have a bar chart representing the status of my runs. I would like to make some sort of button or filter... so that I could change the range of the date. Ex: 1 day, 7 days, 30 days... etc. Is this even possible with an extjs chart? With grids it is, but I'm thinking something similar just with a chart. Something so that upon user selection, it sends the new date and changes the query.
Opinions, examples?
Yes, it would work in exactly the same way. Just call the appropriate methods (sort, filter, load) on the store and the chart will update.
I have to build some chart in my page,I use extjs chart now,but I found it is rather heavy...
Through the google,there some jquery based lib,but I have no idea which is better,and it seems test them one by one is not a good idea,so I ask you guys if you have any experiences?
I just care the following points:
1)support drawing chart based json
data.
2)reload chart when data refreshed.
3)easily and readable coding
4)the less thrid-part lib needed,the
better.
flot
ticks all your boxes. I have been using it, seems pretty slick to me.
Flot supports column-line combined chart, thats actually why I used it, see here and here for a more comprehensive list of functionality.
I like Flot, which does most of the things you require.
Here's a good list of charting libraries for jQuery:
http://www.reynoldsftw.com/2009/02/6-jquery-chart-plugins-reviewed/