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

Enhance funnel chart label display policy #8759

Merged
merged 10 commits into from
Sep 21, 2018
Merged

Conversation

cuijian-dexter
Copy link
Contributor

@cuijian-dexter cuijian-dexter commented Jul 26, 2018

  1. The value of the fan page of the pie chart is less than a certain value. The label and labelLine of this fan page are not displayed.
  2. Funnel plot position increase insideLeft and insideRight attributes.

Add the limitScale parameter under series. Label, and the parameter value is greater than 0 and less than 1.
To ensure that the pie chart does not show label and labelLine on the fan page that is less than a certain value.

options={
  title: {
    text: '饼图标题',
    left: 16,
    textStyle: {
      fontSize: 14
    }
  },
  tooltip: {
    trigger: 'item',
    axisPointer: {
      //坐标轴指示器,坐标轴触发有效type: 'shadow'//默认为直线,可选为:'line'|'shadow'
    },
    extraCssText: 'max-width: 300px; word-break:break-all; white-space: normal'
  },
  legend: {
    data: [
      
    ]
  },
  series: [
    {
      type: 'pie',
      label: {
        normal: {
          show: true,
          limitScale: 0.02//小于2%的,不显示
        },
        emphasis: {
          show: true,
          textStyle: {
            fontSize: '14',
            fontWeight: 'bold'
          }
        }
      },
      labelLine: {
        lineStyle: {
          color: '#D9D9D9'
        }
      },
      data: [
        
      ]
    }
  ]
};

@cuijian-dexter
Copy link
Contributor Author

cuijian-dexter commented Jul 26, 2018

Label line may be outside the canvas when pie items are too much. #8390 #8507

@cuijian-dexter
Copy link
Contributor Author

cuijian-dexter commented Jul 26, 2018

漏斗图中的label是否可以支持position等于insideLeft和insideRight #7596

@cuijian-dexter cuijian-dexter changed the title 饼图的扇页的值小于一定值,不显示此扇页的label和labelLine 1.饼图的扇页的值小于一定值,不显示此扇页的label和labelLine。2.为漏斗图position增加insideLeft和insideRight Jul 26, 2018
@Ovilia
Copy link
Contributor

Ovilia commented Sep 3, 2018

@cuijian-dexter Hi @cuijian-dexter , I think this feature is very useful although we have to discuss it in details. But first of all, could you please change the title and comments into English so that more community members can understand? Thanks!

@cuijian-dexter
Copy link
Contributor Author

@Ovilia ok,I'll change it right away

@cuijian-dexter cuijian-dexter changed the title 1.饼图的扇页的值小于一定值,不显示此扇页的label和labelLine。2.为漏斗图position增加insideLeft和insideRight 1.the value of the fan page of the pie chart is less than a certain value. The label and labelLine of this fan page are not displayed.2.为漏斗图position增加insideLeft和insideRight Sep 3, 2018
@cuijian-dexter cuijian-dexter changed the title 1.the value of the fan page of the pie chart is less than a certain value. The label and labelLine of this fan page are not displayed.2.为漏斗图position增加insideLeft和insideRight 1.the value of the fan page of the pie chart is less than a certain value. The label and labelLine of this fan page are not displayed.2.funnel plot position increase insideLeft and insideRight Sep 3, 2018
@cuijian-dexter cuijian-dexter changed the title 1.the value of the fan page of the pie chart is less than a certain value. The label and labelLine of this fan page are not displayed.2.funnel plot position increase insideLeft and insideRight 1.the value of the fan page of the pie chart is less than a certain value. The label and labelLine of this fan page are not displayed./n2.funnel plot position increase insideLeft and insideRight Sep 3, 2018
@cuijian-dexter cuijian-dexter changed the title 1.the value of the fan page of the pie chart is less than a certain value. The label and labelLine of this fan page are not displayed./n2.funnel plot position increase insideLeft and insideRight 1.the value of the fan page of the pie chart is less than a certain value. The label and labelLine of this fan page are not displayed.<br/>2.funnel plot position increase insideLeft and insideRight Sep 3, 2018
@cuijian-dexter cuijian-dexter changed the title 1.the value of the fan page of the pie chart is less than a certain value. The label and labelLine of this fan page are not displayed.<br/>2.funnel plot position increase insideLeft and insideRight 1.the value of the fan page of the pie chart is less than a certain value. The label and labelLine of this fan page are not displayed.2.funnel plot position increase insideLeft and insideRight Sep 3, 2018
@cuijian-dexter cuijian-dexter changed the title 1.the value of the fan page of the pie chart is less than a certain value. The label and labelLine of this fan page are not displayed.2.funnel plot position increase insideLeft and insideRight 1.the value of the fan page of the pie chart is less than a certain value. The label and labelLine of this fan page are not displayed.2.funnel plot position increase insideLeft and insideRight attributes. Sep 3, 2018
@Ovilia Ovilia changed the title 1.the value of the fan page of the pie chart is less than a certain value. The label and labelLine of this fan page are not displayed.2.funnel plot position increase insideLeft and insideRight attributes. Enhance pie chart label display policy Sep 3, 2018
textX = (points[0][0] + points[1][0] + points[2][0] + points[3][0]) / 4;
textY = (points[0][1] + points[1][1] + points[2][1] + points[3][1]) / 4;
textAlign = 'center';
if (labelPosition === 'insideLeft'){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add space: if (labelPosition === 'insideLeft') {.
Also change the similar problems.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok,thank you

textY = (points[0][1] + points[1][1] + points[2][1] + points[3][1]) / 4;
textAlign = 'center';
if (labelPosition === 'insideLeft'){
textX = (points[0][0] + points[3][0])/2 + 5;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

) / 2

@Ovilia
Copy link
Contributor

Ovilia commented Sep 3, 2018

@cuijian-dexter The pie chart label filtering and funnel label positioning seems to be two different topics. I reviewed the funnel part and that seems to be working. How about removing the pie chart part in this PR (you can make another PR later)?
And please format your code as I mentioned above.
Thanks for your contribution.

@cuijian-dexter
Copy link
Contributor Author

cuijian-dexter commented Sep 3, 2018

@Ovilia
This is the options of pie chart.Adding the limitScale parameter.
Less than limitScale, do not show.
Do I need to resubmit a Pull Request?

options = {
        title: {
           text: '饼图标题',
            left: 16,
            textStyle: {
                fontSize: 14
            }
        },
        tooltip : {
            trigger: 'item',
            axisPointer : {            // 坐标轴指示器,坐标轴触发有效
                type : 'shadow'        // 默认为直线,可选为:'line' | 'shadow'
            },
            extraCssText: 'max-width: 300px; word-break:break-all; white-space: normal'
        },
        legend:{
            data: []
        },
        series: [
            {
                type: 'pie',
                label: {
                    normal: {
                        show: true,
                        limitScale:0.02//小于2%的,不显示
                    },
                    emphasis: {
                        show: true,
                        textStyle: {
                            fontSize: '14',
                            fontWeight: 'bold'
                        }
                    }
                },
                labelLine: {
                    lineStyle: {
                        // color: '#D9D9D9'
                    }
                },
                data: []
            }
        ]
    };

@Ovilia
Copy link
Contributor

Ovilia commented Sep 3, 2018

You need to remove the pie-related code from the PR. Undo the changes in pie chart; commit; pull request.
Here's how to open another PR on GitHub: https://stackoverflow.com/questions/8450036/how-to-open-multiple-pull-requests-on-github You can also wait for the PR to be closed and then add a new PR.

@cuijian-dexter
Copy link
Contributor Author

@Ovilia Okay, I have deleted the pie-related code.

@cuijian-dexter
Copy link
Contributor Author

@Ovilia new pull request of pie charts #8997

@Ovilia Ovilia changed the title Enhance pie chart label display policy Enhance funnel chart label display policy Sep 4, 2018
@Ovilia
Copy link
Contributor

Ovilia commented Sep 4, 2018

@cuijian-dexter Very close now! Please see https://github.com/apache/incubator-echarts/pull/8759/files for my comments and fix them. And revert the changes in src/chart/pie/pieLayout.js.

Copy link
Contributor Author

@cuijian-dexter cuijian-dexter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Funnel plot position increase insideLeft and insideRight attributes.

textX = (points[0][0] + points[1][0] + points[2][0] + points[3][0]) / 4;
textY = (points[0][1] + points[1][1] + points[2][1] + points[3][1]) / 4;
textAlign = 'center';
if (labelPosition === 'insideLeft'){
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok,thank you

@cuijian-dexter
Copy link
Contributor Author

@Ovilia should I delete this file src/chart/pie/pieLayout.js ?

@cuijian-dexter
Copy link
Contributor Author

@Ovilia It seems to be OK. I'm very sorry, this is my first time to contribute code, not very skilled.
Thank you for your help. I will try my best.

@Ovilia
Copy link
Contributor

Ovilia commented Sep 10, 2018

Please don't be sorry. That's OK and we very appreciate your contribution.
One problem here. You need to fix the code style as I commented at https://github.com/apache/incubator-echarts/pull/8759/files .

@cuijian-dexter
Copy link
Contributor Author

@Ovilia ok, Already fixed the code style.Add space

Copy link
Contributor

@Ovilia Ovilia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few more changes.. I believe they are the last ones. 😄

textX = (points[0][0] + points[3][0]) / 2 + 5;
textY = (points[0][1] + points[3][1]) / 2;
textAlign = 'left';
}else if (labelPosition === 'insideRight') {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be } else if

textX = (points[1][0] + points[2][0]) / 2 - 5;
textY = (points[1][1] + points[2][1]) / 2;
textAlign = 'right';
}else {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

} else {

@cuijian-dexter
Copy link
Contributor Author

@Ovilia Have already been solved

@Ovilia Ovilia merged commit e4c4e0e into apache:master Sep 21, 2018
@Ovilia
Copy link
Contributor

Ovilia commented Sep 21, 2018

@cuijian-dexter Thanks for your contribution! 🌟🌟🌟🌟🌟
Now you are one of the ECharts contributors. Since we joined Apache group, you need to assign ICLA for your first PR.
Please fill in the PDF and print it, then sign on it and send the scanned file to dev@echarts.apache.org.
This may be a little tricky, and sorry for the trouble. This is required for the first time your commit is merged in. If you refused, your commit will be backed off.

And are you interested in being an ECharts committer? This has more restrict rules than contributors. Committers are those who contribute more frequently and play more important roles on ECharts project.

After being a committer:

  • You can have write access to the ECharts code
  • You can mange issues (add tags, assign to someone, ...)
  • You can discuss about features with us committers more frequently with Email
  • You name and personal page link will be displayed at ECharts Website About page
  • See this for more information

If you are interested, here's what you can do:

  • Subscribe our mailing list by send an email to dev-subscribe@echarts.apache.org
  • When you want to discuss with us about something, send email to dev@echarts.apache.org
  • Help others by replying issues regularly
  • Make more useful pull requests (fix bugs or make enhancement in issues)

Here are some issues that may be easier to be fixed: https://github.com/apache/incubator-echarts/projects/3

And you will be invited to be a committer when we think your contribution and knowledge of ECharts project is enough. We are looking forward to this! 😃

@cuijian-dexter
Copy link
Contributor Author

@Ovilia Thank you
I am very happy to be one of the contributors to the project.
I am interested in becoming a committer.
Whenever I have time, I will try my best to help solve the problem. I hope to be a committer early.

Ovilia added a commit that referenced this pull request Sep 21, 2018
Ovilia added a commit that referenced this pull request Sep 21, 2018
@Ovilia
Copy link
Contributor

Ovilia commented Sep 21, 2018

@cuijian-dexter Thanks, please send scanned PDF as soon as possible. ⭐️

@cuijian-dexter
Copy link
Contributor Author

@Ovilia It has been sent the scanned file to dev@echarts.apache.org.Please check it.

@Ovilia
Copy link
Contributor

Ovilia commented Oct 8, 2018

@cuijian-dexter Sorry for the late reply. I didn't receive the file from dev@echarts.apache.org.
Did you subscribed the mailing list? Could you receive it?
Could you please send it to oviliazhang@gmail.com?

@cuijian-dexter
Copy link
Contributor Author

@Ovilia ok

@Ovilia
Copy link
Contributor

Ovilia commented Oct 17, 2018

I've sent the email but the secretary did not reply. There are some other new contributors sending ICLA file and got no reply. I'll send an email to mentor about this.

@cuijian-dexter
Copy link
Contributor Author

@Ovilia ok

@cuijian-dexter
Copy link
Contributor Author

I've sent the email but the secretary did not reply. There are some other new contributors sending ICLA file and got no reply. I'll send an email to mentor about this.

Now,what should I do?

@Ovilia
Copy link
Contributor

Ovilia commented Oct 18, 2018

I got an email that your ICLA file has been accepted. Congratulations!

@cuijian-dexter
Copy link
Contributor Author

@Ovilia Thank you!😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants