-
Notifications
You must be signed in to change notification settings - Fork 19.6k
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 chart adds filterValue parameter #8997
Conversation
…ue. The label and labelLine of this fan page are not displayed.
About the code: (1) I think the option should not be on (2) Discussion: (3) @cuijian-dexter the model should not be modified in the layout stage. |
@100pah |
Is this |
@100pah |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the late reply.
Thanks @cuijian-dexter .
But I think that filterValue
probably still does not cover this feature.
em... it is a percent value or angle value, and used to hide label but display segment as usual.
But filter
indicates that totally all value and corresponding graphic elements removed.
May be, although not neat, cropLabel
? labelCropThreshold
? labelHideThreshold
?
@Ovilia
src/chart/pie/PieView.js
Outdated
var itemModel = data.getItemModel(idx); | ||
var valueDim = data.mapDimension('value'); | ||
var sum = data.getSum(valueDim); | ||
var filterValue = seriesModel.getModel('filterValue'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// Should be
var xxxValue = seriesModel.get('xxxValue');
I'd better say |
@Ovilia |
Let @100pah have a final review. |
@100pah hello,Can you make the final review? |
src/chart/pie/PieView.js
Outdated
var sum = data.getSum(valueDim); | ||
var filterValue = seriesModel.get('labelDisplayThreshold'); | ||
var filterIgnore = false; | ||
if (sum * filterValue.option > itemModel.option.value) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does seriesModel.get('labelDisplayThreshold')
returns an object
?
@100pah check it again.Thanks
|
If you add a new configure option, please also update document both in English and Chinese. Thanks! |
@cuijian-dexter Replied under #8759. :) |
@100pah Please review this PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for my late reply.
src/chart/pie/PieView.js
Outdated
@@ -319,7 +327,8 @@ var PieView = ChartView.extend({ | |||
); | |||
|
|||
var selectedMode = seriesModel.get('selectedMode'); | |||
|
|||
var valueDim = data.mapDimension('value'); | |||
data._sum = data.getSum(valueDim) || 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By convention, a property name prefixed by a single '_'
represents a "private member" of a class. We should not add other that kind of properties (_xxx
) outside the class definition dynamically. Otherwise, it probably confuses the code reader and might overwrite the inner private members with the same name.
If we need to save the sum
here, it's OK to save it to this
, because in this module we have the legal control of this
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok,I can save sum
to this
.I change it
@100pah Already bind |
@cuijian-dexter Sorry for my late reply. |
…w the style of `minAngle` `startAngle`) (2) move the logic to the "layout" phase, which is able to skip the process that avoid label overlap if do not display. See more info in #8997
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.