How to group area chart extremes for x-axis dynamically with day,week,months value in highstock - highcharts

Need to display area chart in with highstocks for 1 day,1 week,1 month,6 month,1year and 5 years providing the data at once for all the 5 years.But in case of day it is displaying date with time on x-axis which is not required.How can this date be removed as only time is to be displayed (Eg 9 10 11 ....4 5)
Many thanks in advance.

You can use tickPositioner which allows to set tick, dynamically, based on your data and function.
http://api.highcharts.com/highstock#xAxis.tickPositioner

Related

Highcharts: Display average hour values from a series of quarter-hourly values

My weather station collects every 15 minutes the current temperature. With Highcharts I created a chart to display the last 24h. So I pass all the 96 quarter-hourly values to the chart. This looks not so pretty. Instead I would just display the average of each hour.
Is it possible to display the average value for each hour based on a series of quarter-hourly values and leaving the calculation to Highcharts and not doing it myself?
You can use highstock which allows to use datagrouping.

highcharts x-axis datetime value for one week coming wrong

im using highcharts for reports the x-axis
type:datetime and tickinterval:23 * 24 * 3600 * 1000
, i have another dropdown where in
i can select the CurrentYear,Past 30 days,Previous Month, Current Month,Past 7 days, Previous week , CurrentWeek report the data comes
according to the selected value for CurrentYear the x-axis shows values jul'13,Aug'13,Sep'13...Mar'14 which is right since the tickinterval
is 1 month , but as soon as i select the one week report / current week report x-axis shows no point on it..i want atleast two point on
the x-axis. i thought of using min and max for the same but can't use since the values of min and max will change according to the
weeks.so is there any logic that will make my x-axis value constant to say 6 values or 5values of dates
In general, instead of setting tickInterval, try to set tickPixelInterval - Highcharts will try to fix tick positions to fit pixel interval between them. It won't be exactly the same distance as you set in tickPixelInterval but something really close.
You have also another solution, when you set new data from dropdown you can also call: chart.xAxis.update({ tickInterval: newvalue }) so for each dropdown value, you can set new interval, which workaround your issue.

Skip x axis points on highcharts

I am trying to figure out if this can be done with Highcharts. I have 5 different series on my chart and my X axis is made up of Dates. My problem is this, lets say Series 1 has 2 data points 10 and 15 with dates of 5/1/2013 and 5/3/2013. My second Series has Data that is 15 and 20 with dates of 5/1/2013 and 5/4/2013.
What will end up happening is that 5/1/2013 will show up twice and 5/4/2013 wont show up at all.
Now if I remove the duplicate dates, it causes another issue if Series 3 is 5, 10 with 5/3/2013 and 5/4/2013, Instead of the 5 being listed on 5/2/2013 it is showing up on 5/1/2013.
Is there any way around this? or will I have to make different charts for each Series I want listed on there?
Thanks,
Chris

Highcharts: Can I display only part of a series?

I have a query regarding display of stock data in highstock.
Firstly:
I want to hide price of last 10 months from a total data of 60 months. I want the months to be displayed (i.e. x-axis should have all 60 months), but want the data to be displayed only for first 50 months.
Secondly:
If an event is triggered (say click) I want these last 10 prices also to be displayed (in additional to the original 50).
Is there a logic/pre-processing in Highcharts/Highstock that can make my implementation efficient such that I do not have to break up my JSON data files?
So you can set serie with 50 points and after click event action, call http://api.highcharts.com/highcharts#Series.addPoint() function (in iteraction) which adds new points missing values.

Highcharts - changing x-axis labels with rangeselector

I am trying to use the highstock graph. I want to update the xAxis labels according to the range which is selected from the rangeselector. eg. if it's a 1-year graph, i want the ticks to be at the end of each month with labels as Jan-12,Feb-12 etc.(by default it shows each month as the beginning of that month). And if it's a monthly graph i want the labels to be positioned at each friday ie. at an interval of 7 days.
Is there a way i can dynamically change which labels are displayed on the axis based on the extremes?
You can use tickPositioner (http://api.highcharts.com/highcharts#xAxis.tickPositioner) or formatter to change labels name http://api.highcharts.com/highcharts#xAxis.labels.formatter

Resources