pissang commented on a change in pull request #15095:
URL: https://github.com/apache/echarts/pull/15095#discussion_r652519737
##########
File path: src/chart/pie/PieView.ts
##########
@@ -242,6 +243,29 @@ class PieView extends ChartView {
}
}
+ // remove empty-circle(which is not instance of PiePiece) if it exists
+ group.children().forEach(child => {
+ if (!(child instanceof PiePiece)) {
Review comment:
It's not a good way to check if it's the empty-circle element by
checking it's not a piece of the pie. It may have issues if we add other
elements that are not a piece of the pie further.
A better way is to save this empty-circle element as a private property of
PieView. It's simpler and more robust.
##########
File path: src/processor/negativeDataFilter.ts
##########
@@ -0,0 +1,44 @@
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
+import { StageHandler } from '../util/types';
+
+export default function negativeDataFilter(seriesType: string): StageHandler {
+ return {
+ seriesType: seriesType,
+ reset: function (seriesModel, ecModel) {
+ const legendModels = ecModel.findComponents({
+ mainType: 'legend'
+ });
+ if (!legendModels || !legendModels.length) {
Review comment:
I think it's not necessary to check if there is `legend`?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]