Page 1 of 1
Highcharts WindDir Problem
Posted: Thu 16 Apr 2015 10:55 pm
by GraemeT
I'm having trouble with the WindDir graph not initially fitting within the graph area and the direction scales seem to compress and fold over once the data is loaded. It partially corrects itself when any of the scale buttons are clicked.
Everything else seems to work as expected. Has anyone else had this occur or am I doing something wrong here?
http://weather.gktnet.com/graphs-hc.php
Thanks,
Graeme
Re: Highcharts WindDir Problem
Posted: Fri 17 Apr 2015 8:00 am
by mcrossley
Oddly I don't see it on your graph but I do on mine! It started with one of the HighCharts updates and I haven't had time to investigate.
The Wind Direction graph uses a bit of a hack to plot the points, the standard plotting was a bit slow, particularly on mobile devices. There is a call in there to clip to the plot area but it doesn't seem to work properly - or rather if you watch closely it does clip to the plot area at first, then HighCharts seems to redraw the plot and clip gets lost on the left hand side for some reason.
Re: Highcharts WindDir Problem
Posted: Fri 17 Apr 2015 9:09 am
by mcrossley
OK, I have finally had a look at this - thanks for the prompt!
I seem to have fixed it on my graph (now also using the latest version of HighStock) by adding the option animation:false to the scatter plot options.
Code: Select all
options.plotOptions = {
scatter: {
cursor: 'pointer',
enableMouseTracking: false,
marker: {
states: {
hover: {enabled: false},
select: {enabled: false}
}
},
shadow: false,
animation: false
}
};
It was the redraw at the end of the animation (which doesn't do anything with the 'fast scatter plot' hack in place) which seemed to ignore the clip.
Re: Highcharts WindDir Problem
Posted: Fri 17 Apr 2015 9:56 am
by GraemeT
Yep. That's fixed it!
Cheers,
Re: Highcharts WindDir Problem
Posted: Fri 17 Apr 2015 10:31 pm
by GraemeT
Hi Mark,
Something still not right...
All ok in IE but still having a problem with the y axis Direction scale when using Firefox on pc, and Firefox or Chrome on Samsung Android device.
Displays ok while data loading, but seems to fold the N, NE, E, SE part of the scale to the top of the chart area when it displays the data.
Doesn't happen on your site, but does with mine and this site:
http://www.users.on.net/~jay.jukes/graphs.php
Cheers,
Re: Highcharts WindDir Problem
Posted: Sat 18 Apr 2015 2:06 pm
by mcrossley
Hmm, newer version of HighCharts seem to be trying a bit harder to 'do their own thing' with the axis labels
I have forced mine by adding in tickAmount: 9 to both axes - it only seems to be required on the primary y-axis, but...
Re: Highcharts WindDir Problem
Posted: Sat 18 Apr 2015 9:53 pm
by GraemeT
Thanks Mark.
That looks much better now.