Danton
Posts: 5
Joined: Fri Dec 03, 2021 5:02 pm

Access stock gui plot line data

Hello there,
I was wondering if it would be possible to access, if it exists, the data inherent the position of plot lines after adding them manually through the stocktools gui interface. I'm interested in the number of plotlines and the x value in particular. I would like to know if there is some sorts of structure/object where all data about indicators are stored after addition of said plotline. Or do I need to make a tailored plugin for it ?
PS: highcharts is a very cool tool, cheers
mateusz.b
Posts: 2006
Joined: Tue Jul 13, 2021 11:34 am

Re: Access stock gui plot line data

Hello Danton,

Thanks for contacting us with your question. Really glad to hear that you like Highcharts!

Yes, something like that is possible, all annotations and their options are available under chart.annotations property. Their x and y values too.
Demo: https://jsfiddle.net/BlackLabel/ta5m3h0g/

Let me know if you have any further questions!
Regards!
Mateusz Bernacik
Highcharts Developer
Danton
Posts: 5
Joined: Fri Dec 03, 2021 5:02 pm

Re: Access stock gui plot line data

Thank you, that's exactly what I was looking for.
If I may, I would like to ask one more thing, when I add a vertical line I noticed that the x coordinate of the line does not match entirely with the x coordinate of the point I want to select, for example when I try to add a vertical line to the point at 7-12-2021 10.00 ( x axis of the chart holds hourly data ), the x coordinate of the vertical line is usually a little bit off, indicating something like 7-12-2021 10.43, Is there an option where I can tell the lines to match the points on my chart ? my xAxis is a datetime type, and I already tried to use the snap set to true in the crosshair object in order to have them match, but it didn't work.
mateusz.b
Posts: 2006
Joined: Tue Jul 13, 2021 11:34 am

Re: Access stock gui plot line data

Hi Danton,

If I understood correctly you would like to have something like crosshair snap but for annotations. Is that right? Unfortunately it is not implemented yet, but you can leave your feedback on highcharts user voice (https://highcharts.uservoice.com/forums ... script-api) or create feature request on our github https://github.com/highcharts/highchart ... new/choose

If are looking for something else please let me know.
Regards!
Mateusz Bernacik
Highcharts Developer
Danton
Posts: 5
Joined: Fri Dec 03, 2021 5:02 pm

Re: Access stock gui plot line data

Yeah kinda, the thing is that I only have data corresponding to a particular timeframe, so I wasn't expecting that the vertical lines I would insert manually ( with the mouse ) would fit between my data giving me bogus x coordinates that shouldn't exists. Anyway I think I should be able to make some approximations based on the vicinity or something.
Thanks.
mateusz.b
Posts: 2006
Joined: Tue Jul 13, 2021 11:34 am

Re: Access stock gui plot line data

Hi Danton,

Thanks for explanation. As I said something like that is not implemented yet. I think it would be a great feature though.As you have already noticed it should work fairly similar to crosshair with snap option. To have an annotation with exact timestamp as a point you need to add it programmatically. The idea with approximation definitely makes sense and maybe you could try to create some kind of a click event where you look for the closest point and insert an annotation based on that point position.

In case of any further questions feel free to contact us again!
Regards!
Mateusz Bernacik
Highcharts Developer

Return to “Highcharts Stock”