jb9000
Posts: 7
Joined: Wed Aug 30, 2023 11:21 am

Drag selection on timeline

Hi there,

How to create a drag selection on only one series in a timeline?

I'm looking for something similar to this, but on a timeline: https://jsfiddle.net/gh/get/library/pur ... on-points/

The 'zooming' can be used to select points, but it selects all series in a timeline:

Code: Select all

chart: {
          renderTo: 'timeline',
          type: 'xrange',
          zooming: { type: 'x', resetButton: { position: { align: 'left', verticalAlign: 'top' } } },
          events: {
            redraw() {
              if (this.resetZoomButton) this.resetZoomButton.hide()
              $('#btn_reset_view').prop('disabled', false)
              $page.redrawEvent()
            },
            click: function () {
              $page.resetView()
            },
            selection: selectPointsByDrag
          }
        },
resulting in:
Screenshot 2024-11-12 130153.png
Screenshot 2024-11-12 130153.png (9.93 KiB) Viewed 353 times
But e.g. I want to select only the upper set of point, not both...
Like this:
Untitled.png
Untitled.png (69.83 KiB) Viewed 353 times
How is this possible? Perhaps something other than 'zooming' bar?
andrzej.b
Site Moderator
Posts: 307
Joined: Mon Jul 15, 2024 12:34 pm

Re: Drag selection on timeline

Hi,

Thanks for contacting us with your question!

If you set the zooming type to 'x', then everything in a given x-range is selected. Please change the zooming type to 'xy' or 'y'.
If this does not fix the problem, please reproduce the issue in an online editor that I could work on.

Feel free to reach out if you have any further questions.

Kind regards,
Andrzej
Highcharts Developer

Return to “Highcharts Usage”