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

如何修改图表选中区域的边框颜色 #3599

Closed
luhaifeng666 opened this issue Aug 30, 2021 · 2 comments
Closed

如何修改图表选中区域的边框颜色 #3599

luhaifeng666 opened this issue Aug 30, 2021 · 2 comments

Comments

@luhaifeng666
Copy link

image
在设置了 chart.interaction('element-active'); 之后,如何修改选中区域border的色值?

@Shamann
Copy link
Contributor

Shamann commented Sep 6, 2021

You can define the border color of the active area by specifying the active state options when creating a geometry:

chart
  .interval()
  .position('月份*月均降雨量')
  .color('name')
  .state({
    active: {
      style: {
        stroke: 'red'
      }
    }
  });

If you need to produce the active element's style based on its default style, you may use style function. Please, refer to this example: https://codepen.io/Shamann/pen/JjJbXRN.

@luhaifeng666
Copy link
Author

You can define the border color of the active area by specifying the active state options when creating a geometry:

chart
  .interval()
  .position('月份*月均降雨量')
  .color('name')
  .state({
    active: {
      style: {
        stroke: 'red'
      }
    }
  });

If you need to produce the active element's style based on its default style, you may use style function. Please, refer to this example: https://codepen.io/Shamann/pen/JjJbXRN.

Got it!Thanks for all your support~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants