apache / echarts

Apache ECharts is a powerful, interactive charting and data visualization library for browser
https://echarts.apache.org
Apache License 2.0
60.48k stars 19.62k forks source link

漏斗图不支持更改高亮样式 #10345

Closed kathy-wazowski closed 5 years ago

kathy-wazowski commented 5 years ago

Version

4.2.1

Steps to reproduce

设置 itemStyle normal 和 emphasis 同一个 color 值

What is expected?

不想要默认的高亮样式,想 hover 上去时颜色不变

What is actually happening?

设置了 normal 和 emphasis 同一个 color 值,hover 上去还是变色了。 新、旧写法都不行


全部 option 如下,效果在第一个 data 上。

option = { title: { text: '漏斗图', subtext: '纯属虚构' }, tooltip: { trigger: 'item', formatter: "{a}
{b} : {c}%" }, toolbox: { feature: { dataView: {readOnly: false}, restore: {}, saveAsImage: {} } }, legend: { data: ['展现','点击','访问','咨询','订单'] }, series: [ { name:'漏斗图', type:'funnel', left: '10%', top: 60, //x2: 80, bottom: 60, width: '80%', // height: {totalHeight} - y - y2, min: 0, max: 100, minSize: '0%', maxSize: '100%', sort: 'none', gap: 2, label: { show: true, position: 'inside' }, labelLine: { length: 10, lineStyle: { width: 1, type: 'solid' } }, itemStyle: { borderColor: '#fff', borderWidth: 1 }, emphasis: { label: { fontSize: 20 } }, data: [ {value: [100, 0.4], name: '展现'}, {value: [80, 0.3], name: '点击'}, {value: [60, 0.3], name: '访问'}, {value: [40, 0.22], name: '咨询'}, {value: [20, 0.21], name: '订单'}, {value: [20, 0.21], name: '订单', "itemStyle": { "normal": { "height": "auto" } },},

        ]
    }
]

};

echarts-bot[bot] commented 5 years ago

Hi! We've received your issue and please be patient to get responded. 🎉 The average response time is expected to be within one day for weekdays.

In the meanwhile, please make sure that you have posted enough image to demo your request. You may also check out the API and chart option to get the answer.

Have a nice day! 🍵

cuijian-dexter commented 5 years ago

you can set data[i].itemStyle.emphasis.color

kathy-wazowski commented 5 years ago

you can set data[i].itemStyle.emphasis.color

It doesn't work. 试过了,不生效

Ovilia commented 5 years ago

series.silent 设为 false

echarts-bot[bot] commented 5 years ago

This issue is closed due to not being active. Please feel free to open it again (for the author) or create a new one and reference this (for others) if you have further questions.

kathy-wazowski commented 5 years ago

series.silent 设为 false

不能这样,因为需要图表联动。需要mouseover 的时候,触发事件

heaven2049 commented 4 years ago

eCharts 的文档有问题,请使用 series[0].itemStyle.emphasis.color 设置颜色等

susiwen8 commented 4 years ago

@heaven2049 Could you make a PR to correct it?

heaven2049 commented 4 years ago

@heaven2049 Could you make a PR to correct it?

Sorry, this is my first time viewing echarts source code, I can't confirm this is a documentation issue or a code issue at this moment, but I think it's a code issue.

susiwen8 commented 4 years ago

@heaven2049 Could you make a PR to correct it?

Sorry, this is my first time viewing echarts source code, I can't confirm this is a documentation issue or a code issue at this moment, but I think it's a code issue.

@heaven2049 Ok, but if you found something, please feel free to make a PR.

heaven2049 commented 4 years ago

@heaven2049 Could you make a PR to correct it?

Sorry, this is my first time viewing echarts source code, I can't confirm this is a documentation issue or a code issue at this moment, but I think it's a code issue.

@heaven2049 Ok, but if you found something, please feel free to make a PR.

Due to file: src/chart/funnel/FunnelView.js, updateData function, line 105 polygon.hoverStyle = itemStyleModel.getModel('emphasis').getItemStyle(); I think this line should be like this: polygon.hoverStyle = itemModel.getModel('emphasis').getItemStyle();

pujunliang commented 4 years ago

polygon.hoverStyle = itemModel.getModel('emphasis.itemStyle').getItemStyle();这样才能获取到!