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] Is there a way to safely override Echarts styling / rendering? #20712

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

Comments

@lwangsf
Copy link

lwangsf commented Jan 22, 2025

What problem does this feature solve?

Hi there. If we want to have different styling options, or support different behavior in a chart than the default Echarts options, is there a way for us to customize Echarts in a safe / reliable way? Thank you!

What does the proposed API look like?

N/A

@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 Jan 22, 2025
@helgasoft
Copy link

helgasoft commented Jan 23, 2025

Most of the API is about styling - color, opacity, width, format, etc.
There is an official tool theme-builder. There is also extraCssText available for several chart elements.

@lwangsf
Copy link
Author

lwangsf commented Jan 24, 2025

Thanks @helgasoft for responding!

We were trying to customize the behavior (not just the styling) of the pie chart. See #20626, where we wrote custom rendering code. Is this a reliable way to customize Echarts behavior, or we are not expected to use Echarts this way?

Thanks in advance. I really appreicate your help!

@Ovilia
Copy link
Contributor

Ovilia commented Feb 5, 2025

I'd like to know what you mean by "safe / reliable".

@lwangsf
Copy link
Author

lwangsf commented Feb 7, 2025

Thanks for your response! We want to customize the behavior of certain charts, for example animation by writing custom code. How can could we do so in a way such that any future changes to the Echarts library won't cause regression in the custom behavior we implemented? I'll ask my teammate to provide an example. Thanks.

@cholocate
Copy link

Hi @Ovilia I am also one of the engineers in @lwangsf 's org. I think generally there are some configurations that requires us to go into Zrender in depth instead of using echarts API directly, which is understandable since not all customizations are supported. However, I believe there are some straightforward stylings that we can't change even using the Zrender APIs. For example, a simple styling such as creating a gap between the parent and the child like below for Treemaps (without adding a border because this would shrink the dimensions). This is just one of many subtleties that we have.

Image

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

4 participants