bentobox
Posts: 2
Joined: Tue Jun 12, 2018 9:56 pm

indicators with reactjs

we are using highstock with reactjs using following package: https://www.npmjs.com/package/highcharts-react-official

it is working nicely, we like that we can pass json objects just like it is documented in the demos, and don't have to use jsx tags. however the package probably doesn't include indicators module hence getting error "series type does not exist". need some help on how to integrate indicators in reactjs app. best would be code sample similar to that provided in the above page. thanks
daniel_s
Posts: 783
Joined: Fri Sep 01, 2017 11:01 am

Re: indicators with reactjs

hi bentbox,

Welcome on our forum, and appreciate you contacting us!
Here is the example (among the others) which shows how to use indicators with highcharts-react wrapper:
https://codesandbox.io/s/rmjw8347po

Hope it helps you.

Best regards!
Daniel Studencki,
Highcharts Developer
bentobox
Posts: 2
Joined: Tue Jun 12, 2018 9:56 pm

Re: indicators with reactjs

thanks for the standalone demo, i loaded following module and it worked nicely. tried 'sma' for now, will try other indicators in future.

require("highcharts/indicators/indicators")(Highcharts);
greendo
Posts: 2
Joined: Mon Jun 15, 2020 7:42 pm

Re: indicators with reactjs

Hello, the codesandbox.io link above returns a 404. I have the same question about indicators. Could you repost the example code? Thanks.
piotr.m
Site Moderator
Posts: 1433
Joined: Mon Nov 18, 2019 8:15 am

Re: indicators with reactjs

Hi greendo,

Here you can find this example:
https://stackblitz.com/edit/react-6n8tup?file=index.js

There is a problem with CORS, it blocks data but the structure is preserved.
If we get data from a local file, it works fine:
https://stackblitz.com/edit/react-wy3qim?file=index.js

Let us know it will work for you!

Kind Regards
greendo
Posts: 2
Joined: Mon Jun 15, 2020 7:42 pm

Re: indicators with reactjs

Thank you for the code example, I appreciate it. I haven't gotten it to work in my code yet, but the example is helpful. I'm using a class based component, not hooks. I'll see if I can reorganize my code a bit and get it working.
piotr.m
Site Moderator
Posts: 1433
Joined: Mon Nov 18, 2019 8:15 am

Re: indicators with reactjs

Sure, feel free to contact us if further needed.
Regards!
godwynnn
Posts: 3
Joined: Tue Oct 15, 2024 10:00 am

Re: indicators with reactjs

Any updated solution regarding this custom indicators, I'm trying to implement it on nextjs.

How do I add series for custom indicators to the chart
Last edited by godwynnn on Tue Oct 15, 2024 10:04 am, edited 1 time in total.
User avatar
dawid.d
Site Moderator
Posts: 1217
Joined: Thu Oct 06, 2022 11:31 am

Re: indicators with reactjs

Hi godwynnn,

Welcome to our forum and thanks for the question!

Here you can find a demo with a linear regression custom indicator I ported to React:
https://codesandbox.io/p/sandbox/highch ... x%3A85%2C9

Hope it helps

Best regards,
Dawid Draguła
Highcharts Developer
godwynnn
Posts: 3
Joined: Tue Oct 15, 2024 10:00 am

Re: indicators with reactjs

Hi dawid for custom indicator with options like ma5,apo,willr,adx etc
Can linear regression handle it all
And how do I go about their various type?
User avatar
dawid.d
Site Moderator
Posts: 1217
Joined: Thu Oct 06, 2022 11:31 am

Re: indicators with reactjs

Hello godwynn,

I responded here: viewtopic.php?p=195759#p195759 :D

Best regards,
Dawid Draguła
Highcharts Developer

Return to “Highcharts Stock”