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

饼图相邻区域颜色重复和工具栏想法 #12766

Closed
mumu1349562746 opened this issue Jun 8, 2020 · 16 comments
Closed

饼图相邻区域颜色重复和工具栏想法 #12766

mumu1349562746 opened this issue Jun 8, 2020 · 16 comments
Labels
new-feature stale Inactive for a long time. Will be closed in 7 days. waiting-for: author

Comments

@mumu1349562746
Copy link

What problem does this feature solve?

一下几个问题
1.当前默认的颜色有11种,当我的数据有12种时,第一个和第十二个数据他们挨在一起且颜色相同,完全无法区分
2.关于echarts的工具框(右上角下载等),希望能增加一个鼠标移入移出事件,而不是一直挂在上面,当图很小的时候会遮挡图,利用重新渲染echarts时,会导致里面的图形重叠(尤其是词云图,重叠的更厉害)

What does the proposed API look like?

颜色
以前:color:[‘#666666’,........]
设想:
color:{
static:[‘#666666’,........], //静态块
repeat:'defalut' //最后一个元素的颜色与第一个不重复
}
移入移出
增加一个hover的api吧,类似于jquery,或者是拆开也行,mouseenter,mouseleave

@echarts-bot
Copy link

echarts-bot bot commented Jun 8, 2020

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.

If you don't get helped for a long time (over a week) or have an urgent question to ask, you may also send an email to dev@echarts.apache.org. Please attach the issue link if it's a technical questions.

If you are interested in the project, you may also subscribe our mail list.

Have a nice day! 🍵

@echarts-bot echarts-bot bot added new-feature pending We are not sure about whether this is a bug/new feature. waiting-for: community labels Jun 8, 2020
@mumu1349562746
Copy link
Author

还有就是,当画多个扇形图的时候,如果我想在扇形图中心加文字,找不到相应的属性,也无法彻底的居中

@mumu1349562746
Copy link
Author

可以是这个,不过想要得是一直显示在中间得固定值,就比如所有扇形图得总值,刚刚我已经解决了,上面得问题麻烦看下哈感觉挺关键得,因为我没法用代码逻辑去弥补

@plainheart
Copy link
Member

对于第一个问题,默认情况下 option.color 是依次循环取颜色的,你的意思是说超出了 option.color 范围的不应该再从头取色,而应该是与前边的所有颜色不同?

@mumu1349562746
Copy link
Author

循环取色的时候有可能第一个颜色和最后一个颜色一样,这样造成两个色块看起来像一个一样,我想的是如果需要循环取色的时候,能不能从第二个开始取,然后继续完后顺序取色,这样就能避免相邻的扇面颜色重复的问题了吧

@mumu1349562746
Copy link
Author

还有第二个问题,我觉得挺关键的,因为右上角的工具栏(提供下载,数据视图,还原等工具)本身没有鼠标移入移除的显示规则,我这只能使用重新渲染的方法来弥补,造成的问题就是性能的下降和数据重复渲染的bug(尤其是词云图,因为每次都是随机生成的,所以更加明显)

@mumu1349562746
Copy link
Author

就是toolbox这个东西

@mumu1349562746
Copy link
Author

x希望能回复一下谢谢

@plainheart
Copy link
Member

还有第二个问题,我觉得挺关键的,因为右上角的工具栏(提供下载,数据视图,还原等工具)本身没有鼠标移入移除的显示规则,我这只能使用重新渲染的方法来弥补,造成的问题就是性能的下降和数据重复渲染的bug(尤其是词云图,因为每次都是随机生成的,所以更加明显)

同意你的想法,目前toolbox组件和图表是在一起的,要更新toolbox的状态只能通过chart.setOption的方式,这会导致你说的重新渲染问题,有在考虑是否应该让toolbox可以像tooltip那样支持使用html渲染,从而使其脱离图表本身单独渲染,更新toolbox的状态不会导致图表刷新。

@mumu1349562746
Copy link
Author

我想的是toolbox可以灵活的增加一些事件,比如鼠标移入移除事件,点击事件(这样更加人性化,自定义话)设置样式,可以考虑显示的动画等等方面吧,尽量多的能够用到现代h5的效果,这样一定程度上可以在表现形式上有个很大的提升,能画出图是很牛的,但是能够很好的使用相应的工具保存,分享等那就更好了,可以类似于百度地图那样,有自己的编译器,而不是仅仅局限于插件,可以让更多的用户,哪怕是新手,可以直接复制粘贴的形式来一键设置,百度地图就有这样的东西,设置好样式,然后直接复制json,往地图的bmap里面一塞,完活,完美

@mumu1349562746
Copy link
Author

关于颜色的方面说说你的想法

@plainheart plainheart removed the pending We are not sure about whether this is a bug/new feature. label Jun 15, 2020
@plainheart
Copy link
Member

循环取色的时候有可能第一个颜色和最后一个颜色一样,这样造成两个色块看起来像一个一样,我想的是如果需要循环取色的时候,能不能从第二个开始取,然后继续完后顺序取色,这样就能避免相邻的扇面颜色重复的问题了吧

循环取色的时候什么情况下第一个颜色会和最后一个颜色一样?能提供个例子吗?

@plainheart
Copy link
Member

plainheart commented Jun 16, 2020

还有第二个问题,我觉得挺关键的,因为右上角的工具栏(提供下载,数据视图,还原等工具)本身没有鼠标移入移除的显示规则,我这只能使用重新渲染的方法来弥补,造成的问题就是性能的下降和数据重复渲染的bug(尤其是词云图,因为每次都是随机生成的,所以更加明显)

能否麻烦你描述下toolbox组件添加移入移出事件监听的应用场景吗?

@hlr7999
Copy link

hlr7999 commented Dec 22, 2020

颜色重复

option = {
    tooltip: {
        trigger: 'item',
        formatter: '{a} <br/>{b}: {c} ({d}%)'
    },
    series: [
        {
            name: '访问来源',
            type: 'pie',
            radius: ['50%', '70%'],
            data: [
                {value: 335, name: '直接访问'},
                {value: 310, name: '邮件营销'},
                {value: 234, name: '联盟广告'},
                {value: 135, name: '视频广告'},
                {value: 1548, name: '搜索引擎'},
                {value: 310, name: '邮件营销1'},
                {value: 234, name: '联盟广告1'},
                {value: 135, name: '视频广告1'},
                {value: 1548, name: '搜索引擎2'},
                {value: 310, name: '邮件营销2'},
                {value: 234, name: '联盟广告2'},
                {value: 135, name: '视频广告2'}
            ]
        }
    ]
};

image

@github-actions
Copy link
Contributor

This issue has been automatically marked as stale because it did not have recent activity. It will be closed in 7 days if no further activity occurs. If you wish not to mark it as stale, please leave a comment in this issue.

@github-actions github-actions bot added the stale Inactive for a long time. Will be closed in 7 days. label Dec 22, 2022
@github-actions
Copy link
Contributor

This issue has been automatically closed because it did not have recent activity. If this remains to be a problem with the latest version of Apache ECharts, please open a new issue and link this to it. Thanks!

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Dec 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new-feature stale Inactive for a long time. Will be closed in 7 days. waiting-for: author
Projects
None yet
Development

No branches or pull requests

3 participants