Empty bar chart in Vue-ECharts despite working in playground #935
PrimozGodec
started this conversation in
General
Replies: 1 comment 2 replies
-
|
To answer my own question. The problem was that I hadn’t imported and registered the DatasetComponent. To fix it, just import it and include it in the use() array: import { GridComponent, VisualMapComponent, DatasetComponent } from 'echarts/components';
use([GridComponent, BarChart, CanvasRenderer, VisualMapComponent, DatasetComponent]);I initially didn’t suspect this was the cause, since Vue-ECharts usually displays a warning when a required component is missing — but in this case, it was completely silent. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have a simple template with a bar chart that doesn’t render properly in Vue-ECharts, even though the exact same options work fine in the ECharts playground. There are no console errors — the chart only shows the legend, but no bars.
Does anyone know what might be causing this?
I realize that the chart options might look a bit unusual (for example, I’m using type: "value" for both axes even though one could be categorical), but this is just a simplified version of what I’m trying to achieve. My goal is to create a bar chart with custom spacing between bars and custom colors.
Here is the example of an empty chart made using Vue-ECharts:
And how it looks like on EChart playground (same options):
Beta Was this translation helpful? Give feedback.
All reactions