multiple axis alignment control
There seems to be a lot of posts in the forum asking how to align the 0 values of multiple y axes.
My thoughts for implementing this:
Chart level option (like alignTicks): alignBaseline: boolean (default: true)
Axis level option: baseline:(numeric) (default: 0)
By default 0 is the baseline for each axis, and by default the 0 value for each axis is aligned.
The user can set the baseline to any other set of numbers that should be aligned, or turn off alignment.
New experimantal implementation for Highcharts 4.1 is available at http://jsfiddle.net/gh/get/jquery/1.7.2/highslide-software/highcharts.com/tree/master/samples/highcharts/studies/alignthresholds/.
This implementation looks a the threshold on the primary axis (the one first defined), and aligns the threshold of any following axis to that of the primary axis.
-
JP Fortier commented
I'm finding this specific set of data causes extremely long processing times. The browser recommends stopping the script, but it does eventually complete. The result is strange.
http://jsfiddle.net/zLy9sxb7/2/
Is there a workaround?
-
Barney commented
Hi Torstein, I'd like use this code commercially. Could you let me know under which license this code may be used?
-
Anonymous commented
It does not seem like it is included in the main library yet. It would be nice to get this working.
If you have all positive numbers in the primary axis and a mixture of positive and negative in the other, it seems to not align them as the primaryIndex is always 0.
I have updated the fiddle (whether or not it is correct..) and it seems to work when the primary axis index is 0 or is greater than 0.
-
seo chicago commented
Is this now included within the current version or I still need to use the plugin? If yes can we have some samples of it?
Example : https://seochicagoil.com/ -
Dunham commented
Function does not work when there is no 0 in the yAxis (all values are negative)
Example: https://jsfiddle.net/wn5ms162/ -
MITHUN M commented
@Torstein Honsi: Any helpful leads for making it supported in an angularjs project would be great?
-
V. Raguraman commented
Hi Highchart Support Team,
I am reporting Highstock.js have a multiple axis alignment bug. Please see the mail which I got it from support team.
Hi Ragu,
Right now this feature is not implemented in the core and it seems that the plugin isn't fully working. If you want, you can report it as a bug or leave a comment here: https://highcharts.uservoice.com/forums/55896-general/suggestions/2554384-multiple-axis-alignment-control?page=1&per_page=20.
Best Regards,
Paweł Dalek
--
Highsoft Helpdesk
helpdesk@highsoft.comAlso, please refer Jsfiddle : http://jsfiddle.net/o9y5c1at/ for this problem.
-
V. Raguraman commented
We are using Highstock.js column chart with zooming and scrolling. when we scroll the chart, the Y-axis and other secondary axes scale value getting updated, Due to this, the 0-axes is not aligning with the secondary axes correctly. Do you have solution for this problem.
Jsfiddle : http://jsfiddle.net/o9y5c1at/
-
Anon commented
Doesn't seem to work when the series don't overlap (one serie of only positive values and one of only negatives)
-
Thanks for using Highcharts! You still need the plugin for this. Do you have a case where it's not working as expected?
-
Thanks for using Highcharts! You still need the plugin for this. Do you have a case where it's not working as expected?
-
Ashok Raju commented
Has there been an update here? Trying to align two axis 0' points. I'm using Highcharts 6.0.4 npm package.
-
It's not included in Highcharts yet. There are still an issue with how to handle cases when one of the axes' threshold is not in the scale: http://jsfiddle.net/highcharts/gkf9o1vh/.
-
Anonymous commented
Is this now included in current version or I still have to use plugin? If yes do we have some example of it?
-
-
Anonymous commented
How to fix the y axis for multiple line in highchart. In my case, each line is coming with its own y axis. how to handle this >
-
-
Bar series per se don't seem to pose a problem: http://jsfiddle.net/highcharts/v44tf7zy/.
Also, I have fixed the "Maximum call stack size exceeded" error.
@Genís Días this also fixes your case: https://jsfiddle.net/highcharts/8dbfhhkp/3/
-
Anonymous commented
@torstein Any update on the problem of "Uncaught RangeError: Maximum call stack size exceeded" ?
-
Anonymous commented
the implementation does not work with bar charts, it shows empty chart with following console error:
"Uncaught RangeError: Maximum call stack size exceeded"
on line 48 of the plugin code.