apache / echarts

Apache ECharts is a powerful, interactive charting and data visualization library for browser
https://echarts.apache.org
Apache License 2.0
60k stars 19.59k forks source link

[Feature] Store position of labels after dragging #18665

Open snibbo opened 1 year ago

snibbo commented 1 year ago

What problem does this feature solve?

We are using dragable labels, so that a user can fine-tune his visualisation (esp. overlapping labels).

    labelLayout: (params: any) => {
      return {
        align: 'left',
        x: params.labelRect.x,
        y: params.labelRect.y,
        draggable: true
      }

When we toggle between hide and show labels, the position of the labels is reset - and a user needs to drag the labels again.

Also, all labels are resetted when a new data point is added. This makes sense when the overall scale of the chart changes, but with fixed x-/y-axis there should be no harm keeping the label positions as well.

Thank you very much!

What does the proposed API look like?

?

tim-steg commented 2 months ago

Hi, @snibbo (or anyone else interested in this issue), did you ever figure out a solution for this issue? I have a similar use-case for storing the label positions. Thank you!