atomicfuze
Posts: 10
Joined: Fri Aug 05, 2011 5:19 am

High and Low for the entire chart displayed

I'd like to put the High and Low for the entire chart currently displayed at the top of the chart somewhere. Is this possible?

Something like this
Image
hfrntt
Posts: 6393
Joined: Mon Aug 30, 2010 8:41 am
Contact: Website

Re: High and Low for the entire chart displayed

Sure it is, but it requires some custom work. You need just four things:
- your own text element, you can render this using renderer,
- getExtremes() function which show gives you actual min and max point values,
- setEtremes event
- a few Highcharts APIs magic spells

and you can get this: http://jsfiddle.net/yD6G7/1
Slawek Kolodziej
Highcharts support team
atomicfuze
Posts: 10
Joined: Fri Aug 05, 2011 5:19 am

Re: High and Low for the entire chart displayed

Thank you so much for your work. The only problem is it doesn't seem to be displaying accurate hi and low values all the time.
hfrntt
Posts: 6393
Joined: Mon Aug 30, 2010 8:41 am
Contact: Website

Re: High and Low for the entire chart displayed

It shows min/max values which you can read using tooltip, but some values can be different because of dataGrouping.
Slawek Kolodziej
Highcharts support team
smiller
Posts: 19
Joined: Thu Aug 04, 2011 10:07 pm

Re: High and Low for the entire chart displayed

hfrntt, you sir, are a gentleman and a scholar. Great response. Thanks.
atomicfuze
Posts: 10
Joined: Fri Aug 05, 2011 5:19 am

Re: High and Low for the entire chart displayed

I guess I'm not fully understanding. What I need it to do is show the lowest and highest value currently displayed on the graph. When you change the range of data selected then sometimes it doesn't show accurate lows and highs currently displayed. I apologize if this is simple but I don't understand and need that functionality before my boss will authorize me to purchase the license.
thanks,
-Brian
hfrntt
Posts: 6393
Joined: Mon Aug 30, 2010 8:41 am
Contact: Website

Re: High and Low for the entire chart displayed

And as I posted before, it shows extreme values parsed by Highcharts in current zoom. If you're aware that some data are higher or lower, it could be caused by dataGrouping, check the approximation and smoothed properties. If it doesn't help, could you tell me how I can reproduce this issue (I suppose that it requires some your data).
Slawek Kolodziej
Highcharts support team
atomicfuze
Posts: 10
Joined: Fri Aug 05, 2011 5:19 am

Re: High and Low for the entire chart displayed

Just using the example you gave me if you slide the bottom scroll bar to select a larger range it shows a wrong high value.

Image

Image
hfrntt
Posts: 6393
Joined: Mon Aug 30, 2010 8:41 am
Contact: Website

Re: High and Low for the entire chart displayed

I modified it a little bit. I hope it'll work now. See: http://jsfiddle.net/yD6G7/2/
Slawek Kolodziej
Highcharts support team
atomicfuze
Posts: 10
Joined: Fri Aug 05, 2011 5:19 am

Re: High and Low for the entire chart displayed

Fantastic, works like a charm!

Question: I'm also using highcharts "time series, zoomable". I've applied this code to it and the High works but the Low just shows 0.00 no matter what. Do you know what's causing that?

Thanks again.
-Brian
hfrntt
Posts: 6393
Joined: Mon Aug 30, 2010 8:41 am
Contact: Website

Re: High and Low for the entire chart displayed

Sorry for late reply, could you post a link to your site to show this live?
Slawek Kolodziej
Highcharts support team
vondutch9
Posts: 5
Joined: Wed Jun 29, 2011 9:43 am

Re: High and Low for the entire chart displayed

Hi, there seems to be a bug in HighStock code. The high and low values being displayed are of a previous view. For eg, on initially when the chart is loaded in the example fiddle, it shows the values as high:0.74190 Low: 0.67380. The rangeselector button selected is 3m. Now if you select the zoom to be 1m, the high low still shows the old values while if you look from the graph, the high is 0.7024 and the low is 0.67380.

Thus the bug is that the event is fired before updating the extremes and thus reflects the old high low values from the previous range. Appreciate if someone can file a bug in the bug system for this.

Thanks!
vondutch9
Posts: 5
Joined: Wed Jun 29, 2011 9:43 am

Re: High and Low for the entire chart displayed

Here is a fiddle to reproduce the issue - http://jsfiddle.net/FWTFQ/1/.

The apple stock price graph loads with 1m data. Now when I click on '3m' should update the labels for high low (the high should be updated to 422.24 and low to 363.27). When you click again on '1m' or anything else in the range selector, it updates the high lows for the previous range. The high and lows are being read from dataMin and dataMax so it seems they are not being updated properly.
hfrntt
Posts: 6393
Joined: Mon Aug 30, 2010 8:41 am
Contact: Website

Re: High and Low for the entire chart displayed

Yep, but why you didn't read the whole topic? I posted working demo above (exactly here: http://highslide.com/forum/viewtopic.ph ... 742#p53102).
Slawek Kolodziej
Highcharts support team
vondutch9
Posts: 5
Joined: Wed Jun 29, 2011 9:43 am

Re: High and Low for the entire chart displayed

Hi hrfntt, I think you did not get the point. I could make it work. But what I wanted to say is that the values displayed are wrong. Look at this screenshot below.
high_low_bug.jpg
high_low_bug.jpg (27.74 KiB) Viewed 9545 times
In this chart the high and low values being displayed are 406.53 and 373.20 but if you look at the values on the tooltip the high is actually 422.24. Thus the values being displayed on the labels are wrong. When the chart was loaded, 1m was the selected range and the high lows belong to that range. Now when you click on 3m, the range should have updated accordingly with the high as 422.24 and corresponding low but it doesn`t. It only updates after you click on any other button say '1m'. Now '1m' range will display 422.24 as the high which is incorrect. The values displayed on high low labels are not from the current range but the previous range.

Return to “Highcharts Stock”