pissang commented on a change in pull request #13788:
URL: https://github.com/apache/echarts/pull/13788#discussion_r661073692



##########
File path: src/chart/bar/BarSeries.ts
##########
@@ -125,6 +127,8 @@ class BarSeriesModel extends 
BaseBarSeriesModel<BarSeriesOption> {
 
         roundCap: false,
 
+        colorBy: 'seriesName',

Review comment:
       It's not necessary to write `colorBy: 'seriesName'` explicitly in series 
that should use the default colorBy strategy.

##########
File path: src/visual/style.ts
##########
@@ -179,8 +180,9 @@ const dataColorPaletteTask: StageHandler = {
         // Each type of series use one scope.
         // Pie and funnel are using diferrent scopes
         const paletteScopeGroupByType = createHashMap<object>();
-        ecModel.eachSeries(function (seriesModel) {
-            if (!seriesModel.useColorPaletteOnData) {
+        ecModel.eachSeries((seriesModel: SeriesModel<SeriesOption & 
ColorByMixin>) => {
+            const colorBy = seriesModel.getColorBy();
+            if (colorBy === 'seriesId' || colorBy === 'seriesIndex' || colorBy 
=== 'seriesName') {

Review comment:
       I think it will be much more clear if we using a method like 
`seriesModel.isDataLevelColorBy()` instead of checking values each time.




-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to