ecomfe / vue-echarts

Vue.js component for Apache ECharts™.
https://vue-echarts.dev
MIT License
9.43k stars 1.48k forks source link

chart not appear when using option dataset with source #763

Closed Jocelyn-AGORO closed 4 months ago

Jocelyn-AGORO commented 4 months ago

Confirmation

How are you introducing Vue-ECharts into your project?

ES Module imports

Versions

├── echarts@5.4.3 
├── vue@2.7.16 
├── vue-echarts@6.6.8 
├─┬ vue2-color-picker-gradient@0.15.0
│ └── vue@2.7.16  deduped
└─┬ vue2-slide-unlock@0.2.6
  └── vue@2.7.16  deduped

Details

For example for the following option object

option = {
  title: { text: 'Testing Chart Configuration' },
  tooltip: {},
  xAxis: {
    type: 'category',
    name: "Semaine de l'année",
    nameGap: 45,
    nameLocation: 'center',
    position: 'bottom'
  },
  yAxis: {
    name: 'Nombre de connexion',
    nameGap: 45,
    nameLocation: 'center',
    position: 'left'
  },
  dataset: {
    dimensions: ['label', 'value'],
    source: [
      { label: 'Sem. 1', value: 78 },
      { label: 'Sem. 2', value: 15 },
      { label: 'Sem. 3', value: 852 },
      { label: 'Sem. 5', value: 630 },
      { label: 'Sem. 7', value: 26 },
      { label: 'Sem. 8', value: 5 }
    ]
  },
  series: [{ type: 'line' }]
};

Got the following chart : Capture d’écran de 2024-02-22 12-09-12

xAxis "0" not found

On Echarts PlayGround :

Capture d’écran de 2024-02-22 12-12-18

Reproduction

https://stackblitz.com/edit/vue-wejebl?file=src%2FApp.vue

Jocelyn-AGORO commented 4 months ago

I found the problem, it was not a bug, just import "DatasetComponent"