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

饼状图(pie)series里设置startAngle和endAngle无法绘制出半圆环图 #9647

Closed
10 of 23 tasks
BK201c opened this issue Dec 27, 2018 · 5 comments · Fixed by #18820
Closed
10 of 23 tasks

饼状图(pie)series里设置startAngle和endAngle无法绘制出半圆环图 #9647

BK201c opened this issue Dec 27, 2018 · 5 comments · Fixed by #18820

Comments

@BK201c
Copy link

BK201c commented Dec 27, 2018

  • I am using English in this issue. 在这个 Issue 中我使用了英文(强烈建议)。

General Questions

  • Required: I have read the document and examples and tried to solve it by myself. (必填)我读过了文档和教程,并且曾试图自己解决问题。
  • Required: I have searched for similar issues and that didn't help. (必填)我搜索过 issue 但是没有帮助。
  • Required: I have tried with the latest version of ECharts and still have this problem. (必填)我试过最新版本的 ECharts,还是存在这个问题。

In this issue, I have provided information with: 在这个 issue 中我提供了以下信息:

  • Required: issue type;(必填)issue 类型
  • Required: one sentence description in issue details;(必填)一句话的问题描述
  • Required: demo;(必填)能反映问题的例子(如果你想提问或报 bug)
  • Required: ECharts version;ECharts 版本

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

在echart 4.0版本中,series type 为pie 时,使用startAngle和endAngle设置起始刻度无效,

Expected Behavior

使用pie绘制出半圆环形图

Current Behavior

配置项无效果

Online Example

option = {
    tooltip: {
        trigger: 'item',
        formatter: "{a} <br/>{b}: {c} ({d}%)"
    },
    legend: {
        orient: 'vertical',
        x: 'left',
        data:['直接访问','邮件营销','联盟广告','视频广告','搜索引擎']
    },
    series: [
        {
            name:'访问来源',
            type:'pie',
            radius: ['50%', '70%'],
            startAngle:0,
            endAngle:180,
            avoidLabelOverlap: false,
            label: {
                normal: {
                    show: false,
                    position: 'center'
                },
                emphasis: {
                    show: true,
                    textStyle: {
                        fontSize: '30',
                        fontWeight: 'bold'
                    }
                }
            },
            labelLine: {
                normal: {
                    show: false
                }
            },
            data:[
                {value:335, name:'直接访问'},
                {value:310, name:'邮件营销'},
                {value:234, name:'联盟广告'},
                {value:135, name:'视频广告'},
                {value:1548, name:'搜索引擎'}
            ]
        }
    ]
};

Topics

  • Legend
  • Tooltip
  • Event
  • Performance
  • SVG
  • Map
  • ECharts GL
  • Third-party libraries, e.g.: Vue.js, React

Anything Else We Need to Know

Environment

echart 4.2

  • ECharts version;ECharts 版本: {DESCRIBE_HERE}

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

@BK201c BK201c changed the title 饼状图(pie)series里设置startAngle和endAngle无发绘制出半圆环图 饼状图(pie)series里设置startAngle和endAngle无法绘制出半圆环图 Dec 27, 2018
@100pah
Copy link
Member

100pah commented Dec 27, 2018

endAngle is not supported in pie chart yet.

@BK201c
Copy link
Author

BK201c commented Dec 28, 2018

endAngle is not supported in pie chart yet.

thanks for reply,and can i know how to draw a half-circle ring? just use 'startAngle' in the 'pie' or ??

@100pah
Copy link
Member

100pah commented Dec 28, 2018

A tricky way:

option = {
    series : [
        {
            type: 'pie',
            radius : '55%',
            data:[
                {value:335, name:'AA'},
                {value:310, name:'BB'},
                {value:234, name:'CC'},
                {value:135, name:'DD'},
                {value:1548, name:'empty', silent: true, itemStyle: {color: 'rgba(0,0,0,0)'}}
            ]
        }
    ]
};

@BK201c
Copy link
Author

BK201c commented Dec 29, 2018

A tricky way:

option = {
    series : [
        {
            type: 'pie',
            radius : '55%',
            data:[
                {value:335, name:'AA'},
                {value:310, name:'BB'},
                {value:234, name:'CC'},
                {value:135, name:'DD'},
                {value:1548, name:'empty', silent: true, itemStyle: {color: 'rgba(0,0,0,0)'}}
            ]
        }
    ]
};

not bad, but still has a question,can't use 'tooltip' in 'option'.if i do, the 'empty' tooltip will be show when i hover it。anyway,thank you for reply

@100pah
Copy link
Member

100pah commented Jan 1, 2019

@JohnsonWQ

Support tooltip:

option = {
    tooltip: {
        formatter: function (params) {
            if (params && params.name === 'empty') {
                return;
            }
            return ''
                + echarts.format.getTooltipMarker(params.color) 
                + params.name + ': ' + params.value 
                + ' (' + params.percent + '%)';
        }
    },
    series : [
        {
            type: 'pie',
            radius : '55%',
            data:[
                {value:335, name:'AA'},
                {value:310, name:'BB'},
                {value:234, name:'CC'},
                {value:135, name:'DD'},
                {value:1548, name:'empty', silent: true, itemStyle: {color: 'rgba(0,0,0,0)'}}
            ]
        }
    ]
};

@plainheart plainheart added this to the TBD milestone Sep 30, 2020
@Ovilia Ovilia removed this from the TBD milestone Jul 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants