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

Chart not displayed correctly #14

Closed
raphi-0901 opened this issue Feb 7, 2025 · 2 comments
Closed

Chart not displayed correctly #14

raphi-0901 opened this issue Feb 7, 2025 · 2 comments
Labels
question Further information is requested

Comments

@raphi-0901
Copy link

raphi-0901 commented Feb 7, 2025

Hey, I wanted to display a simple pie chart and used your example from here, but I only get the legend:
Image

I created a minimal reproduction here:
https://stackblitz.com/edit/nuxt-starter-ru8xufrv?file=nuxt.config.ts

Apart from that, I also tried to create a bar chart instead and there was no output at all!

Could you please tell me what I am doing wrong?

@kingyue737
Copy link
Owner

kingyue737 commented Feb 8, 2025

Good question. You are using Server Side Rendering of ECharts. Initial width and height must be set, otherwise the server will not know the size of the chart you want to render.

For example:

  <VChartLight :option="option" @click="onClick" :init-options="{width:300, height:300}" />

Ref: ECharts SSR guide

Image

@kingyue737 kingyue737 added the question Further information is requested label Feb 8, 2025
@raphi-0901
Copy link
Author

Thank you! It works now.

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

No branches or pull requests

2 participants