datadoge
Posts: 27
Joined: Sat Aug 28, 2021 11:34 pm

Range selector for non-stock chart

Hi there,

I don't know if this is possible but I would like to use the stock chart range selector as input on a highcharts plot that has no time x-axis.

A possible MWE would be to have a stockchart range selector and the main plot being for example a bar plot with two bars where the hight of each bar is the time stamp (as a number) of the start and the end date of the range selector. Is this possible and can you show me how to implement that?

I found this thread but I don't know if it's possible and how to modify it to fit my needs: viewtopic.php?t=18092
mateusz.b
Posts: 2006
Joined: Tue Jul 13, 2021 11:34 am

Re: Range selector for non-stock chart

Hello datadoge,

It could be possible, and here you can find related topic: viewtopic.php?f=12&t=46020
Demo:https://jsfiddle.net/BlackLabel/f02yx3sa/

The thing is, I don't really understand why would you use range selector in this case. First of all, range selector is a part of Highstock, so you need appropriate license to be able to use it. Second thing is that you dont want time x-axis anyway. I think it would be much easier to add few buttons with styles, and create your own custom range selector like here: https://jsfiddle.net/BlackLabel/064v1qdz/
API reference:https://api.highcharts.com/class-refere ... etExtremes

Let me know what do you think about this approach and feel free to ask any further questions.
Best regards!
Mateusz Bernacik
Highcharts Developer
datadoge
Posts: 27
Joined: Sat Aug 28, 2021 11:34 pm

Re: Range selector for non-stock chart

Hi, thanks for your reply!

Alright, let me try to explain in a bit more detail what I have in mind. I have a time-price series of data and now I would like to plot corresponding metadata change between user-defined points in time. And I think the stocks range selector would just be perfect for that because the user could easily select a time range where e.g. the price took a huge dip and plot the metadata before and after the dip. Do you know what I mean?

The metadata is not a time serious though but a completely different chart.
mateusz.b
Posts: 2006
Joined: Tue Jul 13, 2021 11:34 am

Re: Range selector for non-stock chart

Hello datadoge,

Frankly speaking it is quite hard to understand for me what do you want to achieve. I need even more specified description, preferably with some images and technical details like series type. You've mentioned bar chart as an example, but I don't think it would be a good choice in this case. Reading more into your description it makes me think that you should consider using Highcharts Gantt: https://www.highcharts.com/demo/gantt
Precisely I was thinking about something like that: https://www.highcharts.com/demo/gantt/with-navigation
As you can see in the demo, you have a range selector that allows you to set specific date range and bars that could start and finish with specific timestamps.

You might also want to consider X-range series: https://www.highcharts.com/demo/x-range

Thanks in advance for any details and clarification.

Best regards!
Mateusz Bernacik
Highcharts Developer

Return to “Highcharts Stock”