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

关于dataset遇到的问题 #7733

Closed
cn-xufei opened this Issue Feb 6, 2018 · 3 comments

Comments

Projects
None yet
4 participants
@cn-xufei

cn-xufei commented Feb 6, 2018

One-line summary [问题简述]

使用dataset配置数据,当dimensions中的维度,没有在,source中出现,也就是说,某个维度没有数据,则图表无法渲染,如下图中没有维度‘2017’的数据,整个图表都无法展示
image

Version & Environment [版本及环境]

  • ECharts version [ECharts 版本]: 4.0
  • Browser version [浏览器类型和版本]: Chrome 64
  • OS Version [操作系统类型和版本]: win10

Expected behaviour [期望结果]

希望没有数据的维度不展示,但其他有数据的维度照常展示

ECharts option [ECharts配置项]

option = {
    legend: {},
    tooltip: {},
    dataset: {
        // 这里指定了维度名的顺序,从而可以利用默认的维度到坐标轴的映射。
        // 如果不指定 dimensions,也可以通过指定 series.encode 完成映射,参见后文。
        dimensions: ['product', '2015', '2016', '2017'],
        source: [
            {product: 'Matcha Latte', '2015': 43.3, '2016': 85.8},
            {product: 'Milk Tea', '2015': 83.1, '2016': 73.4},
            {product: 'Cheese Cocoa', '2015': 86.4, '2016': 65.2},
            {product: 'Walnut Brownie', '2015': 72.4, '2016': 53.9}
        ]
    },
    xAxis: {type: 'category'},
    yAxis: {},
    series: [
        {type: 'bar'},
        {type: 'bar'},
        {type: 'bar'},
        {type: 'bar'}
    ]
};

Other comments [其他信息]

@cn-xufei

This comment has been minimized.

cn-xufei commented Feb 7, 2018

👍

1 similar comment
@adsort

This comment has been minimized.

adsort commented Feb 9, 2018

+1

@100pah 100pah closed this in f27f50e Feb 10, 2018

@cn-xufei

This comment has been minimized.

cn-xufei commented Feb 27, 2018

期待尽快发布,辛苦了echarts的攻城狮,希望echarts越来越好🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment