nurettin
Posts: 7
Joined: Mon Sep 28, 2020 4:27 pm

custom indicator with different yAxis

Hi everyone,

I added a new seriesType to Highcharts like

Code: Select all

    Highcharts.seriesType(
        'awesomeindicator',
        'sma',
        { name: "awesome indicator" },
        { getValues: awesomeIndicatorValues }
    )
And I can see it inside the "Indicators" menu. However, they appear in the same yAxis as the series it was linked to. How do I make it show up in a separate yAxis like Aroon series? I tried replacing
sma
with
aroon-oscillator
hoping that it would inherit the separate yAxis behavioro but no cigar.

Thanks for your time.
dominik.c
Posts: 2081
Joined: Fri Aug 07, 2020 7:07 am

Re: custom indicator with different yAxis

Hello nurettin,

Welcome to our forum and thanks for contacting us with your question!

Here you can find the official Aroon demo and see how axis is added and how a normal indicator is added to the separate y-axis:
https://jsfiddle.net/gh/get/library/pur ... ors/aroon/
https://www.highcharts.com/docs/stock/t ... tor-series

If you ask for some automatic indicator addition like it is in our official StockTools demo, it'll be tough. But you can trace how it is done here: https://jsfiddle.net/BlackLabel/vkq435yn/
Just uncomment the debugger and see how the new y-axis is created through chart.addAxis() and then how the indicator is added through chart.addSeries()

Let me know if you have any further questions!
Best regards
Dominik Chudy
Highcharts Developer
nurettin
Posts: 7
Joined: Mon Sep 28, 2020 4:27 pm

Re: custom indicator with different yAxis

Thank you, dominik!
All I had to do was to copy the jsfiddle code over and add my indicator to the list of charts with their separate y-axis. This is solved as long as the internals of highcharts doesn't change. However, it would be very nice to add this as a feature built into the library because custom indicators that oscillate between certain values will always need a separate y-axis. Alternatively, if we inherit parameters from an indicator with separate y-axis, the indicator could also have its own y-axis. That would be even more intuitive.
dominik.c
Posts: 2081
Joined: Fri Aug 07, 2020 7:07 am

Re: custom indicator with different yAxis

Hi again!

I'm glad it's working and thanks so much for your idea nurettin! If you think that it should be added as a feature to Highcharts you can create a feature request on our GitHub. Here you've got a link: https://github.com/highcharts/highchart ... new/choose

Feel free to ask any further questions!
Best regards.
Dominik Chudy
Highcharts Developer
nurettin
Posts: 7
Joined: Mon Sep 28, 2020 4:27 pm

Re: custom indicator with different yAxis

Hi again,

Thanks to dominik.c 's suggestion, this issue is now closed. https://github.com/highcharts/highcharts/issues/15804
dominik.c
Posts: 2081
Joined: Fri Aug 07, 2020 7:07 am

Re: custom indicator with different yAxis

Thanks for sharing this information on our official thread. :)

In case of any further questions, feel free to contact us again.
Best regards.
Dominik Chudy
Highcharts Developer
cheehy
Posts: 2
Joined: Mon Aug 08, 2022 4:32 am

Re: custom indicator with different yAxis

Hi, may I know is this feature available in the highchart latest version (v10)?
Found it had been updated in Highcharts Stock v9.2.0 (2021-08-18), https://www.highcharts.com/blog/changelog/
and request closed https://github.com/highcharts/highcharts/pull/16168.

Cant find any relevance doc for this feature.... :?
kamil.m
Posts: 892
Joined: Thu May 19, 2022 1:33 pm

Re: custom indicator with different yAxis

Hi there,

If you have the latest Highcharts version, feel free to use that feature - it is available in the v10.

In case of any issues, feel free to create a new topic, describe your problem and we will be more than happy to help you,
Best regards!
Kamil Musiałowski
Highcharts Developer

Return to “Highcharts Stock”