Hi
This is how my graphs for wind direction looks like...
Mostly my wind direction is between W and NE, and I would like to have that part in the middle of the graph. Is it doable? Anyone with highchart skills here?
Welcome to the Cumulus Support forum.
Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024
Cumulus MX V4 beta test release 4.0.0 (build 4019) - 03 April 2024
Legacy Cumulus 1 release 1.9.4 (build 1099) - 28 November 2014
(a patch is available for 1.9.4 build 1099 that extends the date range of drop-down menus to 2030)
Download the Software (Cumulus MX / Cumulus 1 and other related items) from the Wiki
Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024
Cumulus MX V4 beta test release 4.0.0 (build 4019) - 03 April 2024
Legacy Cumulus 1 release 1.9.4 (build 1099) - 28 November 2014
(a patch is available for 1.9.4 build 1099 that extends the date range of drop-down menus to 2030)
Download the Software (Cumulus MX / Cumulus 1 and other related items) from the Wiki
[Q] Graphs - changing Wind Dir yAxis
Moderator: mcrossley
- steve
- Cumulus Author
- Posts: 26701
- Joined: Mon 02 Jun 2008 6:49 pm
- Weather Station: None
- Operating System: None
- Location: Vienne, France
- Contact:
Re: [Q] Graphs - changing Wind Dir yAxis
In the code which sets the series data, you could process the array of points and modify it appropriately (add 180 modulo 360 or whatever) and then call setData() with the new array of points. You would also have to modify the array which sets the labels.
This is the existing code:
Something like this might work:
Completely untested and the syntax may not even be correct!
There may be a more clever way using Highcharts itself to do the processing. It would be simpler if Cumulus had it as an option, as in Cumulus 1 - I'll look into it at some point.
This is the existing code:
Code: Select all
$.ajax({
url: 'api/graphdata/wdirdata.json',
dataType: 'json',
success: function (resp) {
chart.hideLoading();
chart.series[0].setData(resp.bearing);
chart.series[1].setData(resp.avgbearing);
}
});
Code: Select all
$.ajax({
url: 'api/graphdata/wdirdata.json',
dataType: 'json',
success: function (resp) {
chart.hideLoading();
for (index = 0, len = resp.bearing.length; index < len; ++index) {
resp.bearing[index][1] = (resp.bearing[index][1] + 180)%360;
}
chart.series[0].setData(resp.bearing);
for (index = 0, len = resp.avgbearing.length; index < len; ++index) {
resp.avgbearing[index][1] = (resp.avgbearing[index][1] + 180)%360;
}
chart.series[1].setData(resp.avgbearing);
}
});
There may be a more clever way using Highcharts itself to do the processing. It would be simpler if Cumulus had it as an option, as in Cumulus 1 - I'll look into it at some point.
Steve
- laulau
- Posts: 678
- Joined: Tue 13 Oct 2009 10:52 pm
- Weather Station: WeatherDuino Pro2
- Operating System: Win 7
- Location: Meyenheim, Alsace, FR
- Contact:
Re: [Q] Graphs - changing Wind Dir yAxis
Like thissteve wrote: You would also have to modify the array which sets the labels.
Code: Select all
var compassP = function (deg) {
var a = ['S', 'SW', 'W', 'NW', 'N', 'NE', 'E', 'SE'];
return a[Math.floor((deg + 22.5) / 45) % 8];
};
You do not have the required permissions to view the files attached to this post.
-
- Posts: 132
- Joined: Thu 26 Jun 2008 5:51 am
- Weather Station: Davis VP2 + Solar
- Operating System: A20 TV box + CumulusMX
- Location: Slov.Konjice, Slovenia
- Contact:
Re: [Q] Graphs - changing Wind Dir yAxis
havent tried it yet, but as it seems it works, gj!
A really nice line, You got there laulau
A really nice line, You got there laulau