ecomfe / vue-echarts

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

使用dataset数据集多纬度时报错 #787

Closed 1054959069 closed 1 month ago

1054959069 commented 1 month ago

请确认

您是如何将 Vue-ECharts 引入项目的?

通过 ES 模块 import

版本信息

vue@2.7.14
echarts@5.5.0
vue-echarts@6.7.2

问题详情

option = { legend: {}, tooltip: { trigger: 'axis', axisPointer: { type: 'shadow' } }, dataset: [ { source: [ { age: 53, name: '张三', sex: '女' }, { age: 19, name: '李娟', sex: '女' }, { age: 19, name: '王兰', sex: '女' }, { age: 20, name: '李四', sex: '男' } ] }, { transform: { type: 'filter', config: { dimension: 'sex', value: '女' } } }, { transform: { type: 'filter', config: { dimension: 'sex', value: '男' } } } ], xAxis: { type: 'category' }, yAxis: {}, series: [ { type: 'bar', encode: { x: 'name', y: 'age' }, name: '女', datasetIndex: 1, label: { show: true, position: 'top' } }, { type: 'bar', encode: { x: 'name', y: 'age' }, name: '男', datasetIndex: 2, label: { show: true, position: 'top' } } ] }; 官网可以展示,但是vue-echarts报错:Error: Can not find transform on type "filter".

问题复现

见上方option

Justineo commented 1 month ago

请提供可以运行的最小化复现。

1054959069 commented 1 month ago

@Justineo https://codesandbox.io/p/sandbox/vue-echarts-783-forked-3sm5dx

Justineo commented 1 month ago

IMG_7453

https://echarts.apache.org/handbook/zh/concepts/data-transform/#%E6%95%B0%E6%8D%AE%E8%BD%AC%E6%8D%A2%E5%99%A8-%2522filter%2522