blacklabel / indicators

Indicators plugin for Highstock by Black Label
http://blacklabel.github.io/indicators/
Other
35 stars 12 forks source link

Require to add indicator in custom yAxis. #53

Closed BDChaudhari90 closed 7 years ago

BDChaudhari90 commented 7 years ago

We have a requirement to maintain ordering of Indicators.

Below is the sample fiddle. http://jsfiddle.net/BDChaudhari90/xdkkk27x/2/

Click on "RSI" button - It will add RSI indicator in separate yAxis. Now I want to add ATR above RSI. - It is possible or not ?

I tried using index property but no luck.

pawelfus commented 7 years ago

It is possible with chart.alignAxes set to false. Then you can control yAxis.top and yAxis.height.

It looks like in 5.x we have a bug here, we need to inform Highcharts that indicators shouldn't be removed on axis update. Workaround: Highcharts.Axis.prototype.keepProps.push('indicators');

Here is a working demo: http://jsfiddle.net/xdkkk27x/4/ - it's not very user-friendly solution, though..

pawelfus commented 7 years ago

Oh, now I realized that issue with update() is reported already as #52.

BDChaudhari90 commented 7 years ago

Thanks @pawelfus I am on Highstock JS v5.0.2 (2016-10-26)...

Is it possible to use Highcharts.Axis.prototype.keepProps.push('indicators'); with Highstock JS v5.0.2 ??

pawelfus commented 7 years ago

Yes, that internal API option was introduced in 5.0.0.

BDChaudhari90 commented 7 years ago

Many thanks @pawelfus ,,

Above solution worked for me. Now I am manually setting height and top of indicator yAxis and it looks fine.