Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Add inactiveColor, inactiveBorderColor, and inactiveBorderWidth to visualMap #20848

Open
gioneves opened this issue Mar 22, 2025 · 0 comments
Labels
en This issue is in English new-feature pending We are not sure about whether this is a bug/new feature.

Comments

@gioneves
Copy link

gioneves commented Mar 22, 2025

What problem does this feature solve?

Currently, visualMap does not provide built-in options to customize the appearance of inactive (unselected) elements in either piecewise or continuous modes. This limitation reduces visual clarity when certain values are deselected, making it difficult to distinguish active and inactive states effectively.

In contrast, the legend component already supports customization of inactive elements using inactiveColor, inactiveBorderColor, and inactiveBorderWidth. However, visualMap lacks these options, leading to inconsistencies when both components are used in the same chart.

For example, when using visualMap.piecewise, unselected categories always appear in a default style that cannot be modified. Similarly, in visualMap.continuous, there is no way to adjust the appearance of unselected ranges, making it harder to visually communicate inactive states.

Adding inactiveColor, inactiveBorderColor, and inactiveBorderWidth would allow users to fully control the appearance of inactive elements in both modes, improving chart customization and usability.

What does the proposed API look like?

The proposed API would introduce three new properties under visualMap that apply to both piecewise and continuous modes:

visualMap: {
  type: "piecewise",  // or "continuous"
  dimension: 2,
  pieces: [ // For piecewise mode
    { min: 0, max: 30, color: "blue" },
    { min: 31, max: 60, color: "orange" },
    { min: 61, max: 100, color: "green" }
  ],
  range: [20, 80], // For continuous mode
  inactiveColor: "#ccc",        // Customize the color of inactive elements
  inactiveBorderColor: "#ccc",  // Customize the border color of inactive elements
  inactiveBorderWidth: "auto"   // Allow automatic or manual control of inactive border width
}

This enhancement would ensure visual consistency between visualMap and the legend, allowing for better differentiation of inactive states in both piecewise and continuous visualizations.

@echarts-bot echarts-bot bot added en This issue is in English pending We are not sure about whether this is a bug/new feature. labels Mar 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
en This issue is in English new-feature pending We are not sure about whether this is a bug/new feature.
Projects
None yet
Development

No branches or pull requests

1 participant