apache / echarts

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

[Bug] Icon of the legend items with dataURI - base64 is not adapting correctly #19786

Open mariafurtadobravo opened 7 months ago

mariafurtadobravo commented 7 months ago

Version

5.5.0

Link to Minimal Reproduction

https://codepen.io/mariahquery/pen/MWRrYaz

Steps to Reproduce

  1. Create a chart using ECharts.
  2. Add dataURI base64 in icon property for the legend property.
  3. Click on the chart legends.

Current Behavior

  1. When the chart is rendered, only one of the icons of the legends is with the custom icon.
  2. When the chart is rendered, the color of each dataset should be reflected on each legend icon.
  3. When we click on one of the legend icons, they change back to the default Apache Echarts icon 'rect'.

Expected Behavior

  1. The chart should render all legend icons with the the shape that dataURI has.
  2. Each legend should keep the custom icon shape when clicked.
  3. The color of each dataset should be reflected on each legend icon.

Environment

- OS: macOs Sonoma 14.3.1
- Browser: Chrome 123.0.6312.87 (Official Build) (arm64)
- Framework: No framework. Vanilla JS

Any additional comments?

No response

helgasoft commented 7 months ago
  • The chart should render all legend icons with the the shape that dataURI has.

Icons types data:image/png and data:image/gif are rendered correctly, but type data:image/svg+xml has a problem on initial rendering, Demo

  • Each legend should keep the custom icon shape when clicked.

use itemHeight and itemWidth for that

  • The color of each dataset should be reflected on each legend icon.

This feature is unavailable for custom icons.