You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by GitBox <gi...@apache.org> on 2021/10/12 14:19:15 UTC

[GitHub] [echarts] susiwen8 commented on a change in pull request #15851: fix(label): label not show on singleaxis

susiwen8 commented on a change in pull request #15851:
URL: https://github.com/apache/echarts/pull/15851#discussion_r727185871



##########
File path: src/chart/helper/labelHelper.ts
##########
@@ -45,6 +45,10 @@ export function getDefaultLabel(
         }
         return vals.join(' ');
     }
+    else {
+        const rawVal = retrieveRawValue(data, dataIndex, 'value');

Review comment:
       For `singleAxis`, the dimension are `['single', 'value']` when data format is an array.  Normally, in [summarizeDimensions](https://github.com/apache/echarts/blob/master/src/data/helper/dimensionHelper.ts#L117) it will assign `value` as `defaultLabel`
   https://github.com/apache/echarts/blob/master/src/data/helper/dimensionHelper.ts#L125
   but in [prepareSeriesDataSchema](
   https://github.com/apache/echarts/blob/master/src/data/helper/createDimensions.ts#L267) it marks `value` as `isExtraCoord` so `singleAxis` would skip this logic.  That cause `defaultLabel`  is an empty array. I was trying to add  
   ```js
       if (defaultedLabel && defaultedLabel.length) {
           defaultedLabel = encode.value.slice();
       }
   ```
   However `value` wasn't always in `DimensionSummary`, also, if data format weren't `array`, which it is allowed. The dimension for `singleAxis` would be `['single']`.




-- 
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: commits-unsubscribe@echarts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org