elastic-charts icon indicating copy to clipboard operation
elastic-charts copied to clipboard

Sorting legend does not work correctly in some cases

Open qn895 opened this issue 2 years ago • 0 comments

Describe the issue

Sorting legend does not work correctly in some cases when there are Area series preceding Line series (or possibly when there are simply multiple series?)

To Reproduce

Case 1:

  1. Go to https://codesandbox.io/s/xenodochial-ptolemy-w5ftu4?file=/src/App.tsx
  2. Toggle between "Enable legendSort" & "Disable legendSort" button
  3. Note that the legend is being sorted correctly/as expected. When sortLegendEnabled === true, Expected bounds should be after Throughput.

Case 2:

  1. Go to https://codesandbox.io/s/recursing-euclid-rjr3x0?file=/src/App.tsx
  2. Note that the legend is NOT being sorted. Even though it uses the same legendSort function as Case 1, Expected bounds still show up before Throughput.

Checklist

  • [x] The proper chart type label has been added (e.g. :xy, :partition)
  • [x] The proper feature labels have been added (e.g. :interactions, :axis)
  • [x] Every related Kibana issue is listed under Kibana Cross Issues list and the kibana cross issue tag is applied

qn895 avatar May 26 '22 01:05 qn895