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

The returned value of pieselectchange missing attribute 'seriesId' #9830

Closed
1 of 7 tasks
kazehaiya opened this issue Jan 23, 2019 · 1 comment · Fixed by OpenTMI/opentmi-default-gui#32 or DeviaVir/zenbot#2011 · May be fixed by dyna-dot/iClient-JavaScript-s#1
Closed
1 of 7 tasks
Labels
en This issue is in English enhancement priority: high
Milestone

Comments

@kazehaiya
Copy link

kazehaiya commented Jan 23, 2019

General Questions

I tried to get Pie's seriesId with pieselectchange funciton while Pie's data is more than two, howerer, I suppose the result is

{
    type: 'pieselected',
    // 系列 ID,可以在 option 中传入
    seriesId: string
    // 数据名称
    name: name,
    // 所有数据的选中状态表。
    selected: Object
}

but I get only

{
    type: 'pieselected',
    // 数据名称
    name: name,
    // 所有数据的选中状态表。
    selected: Object
}

And my series data is

series: [
    {
          name: 'A',
          id: '123',
          center: [90, '101px'],
          radius: [0, '80px'],
          data: [
            { name: 'A1', value: 30 },
            { name: 'A2', value: 60 },
            { name: 'A3', value: 90 }
          ]
        },
        {
          name: 'B',
          id: '12',
          center: [298, '101px'],
          radius: [0, '80px'],
          data: [
            { name: 'A1', value: 30 },
            { name: 'A2', value: 60 },
            { name: 'A3', value: 90 }
          ]
        }
]

Issue Type

  • I have a question to ask about how to use ECharts to ...;我想提问如何使用 ECharts 实现某功能
  • I have a bug to report;我想要报 bug
  • I have a feature to request, e.g.: I'd like a new feature that ...;我需要一个新功能
  • I have a feature to enhance, e.g.: The current feature should be improved in the way that ...;我希望改进某个功能
  • There's something wrong with the documents;文档有些问题
  • Others, or I'm not sure which issue types to choose here;其他,或我不知道应该选什么类型

Issue Details

The result of pieselectchange function missing seriesId params

Expected Behavior

As document's result

{
    type: 'pieselected',
    // 系列 ID,可以在 option 中传入
    seriesId: string
    // 数据名称
    name: name,
    // 所有数据的选中状态表。
    selected: Object
}

Current Behavior

Missing seriesId
{
type: 'pieselected',
// 数据名称
name: name,
// 所有数据的选中状态表。
selected: Object
}

Online Example

Topics

Anything Else We Need to Know

Environment

Vue + vue-echarts + echarts

  • ECharts version;ECharts 版本: { 4.x }

  • It happens only on certain browsers or operating systems. 对于特定浏览器或操作系统才会出现的问题,请提供相应环境信息:{BROWSER_VERSION_OR_OS_INFORMATION_HERE}

@Ovilia
Copy link
Contributor

Ovilia commented Mar 4, 2019

Test example:

var chart = echarts.init(document.getElementById('main'), null, {
    renderer: 'svg'
});
var option = {
    title : {
        text: '某站点用户访问来源',
        subtext: '纯属虚构',
        x:'center'
    },
    tooltip : {
        trigger: 'item',
        formatter: "{a} <br/>{b} : {c} ({d}%)"
    },
    legend: {
        orient: 'vertical',
        left: 'left',
        data: ['直接访问','邮件营销','联盟广告','视频广告','搜索引擎']
    },
    series : [
        {
            id: 'aaa',
            name: '访问来源',
            type: 'pie',
            radius : '55%',
            center: ['50%', '60%'],
            selectedMode: 'single',
            data:[
                {value:335, name:'直接访问'},
                {value:310, name:'邮件营销'},
                {value:234, name:'联盟广告'},
                {value:135, name:'视频广告'},
                {value:1548, name:'搜索引擎'}
            ],
            itemStyle: {
                emphasis: {
                    shadowBlur: 10,
                    shadowOffsetX: 0,
                    shadowColor: 'rgba(0, 0, 0, 0.5)'
                }
            }
        }
    ]
};
chart.setOption(option, true);

chart.on('pieselectchanged', data => {
    console.log(data);
});

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