pissang commented on a change in pull request #11973: fix bug #11528 Modify 
default value of tooltip and label
URL: 
https://github.com/apache/incubator-echarts/pull/11973#discussion_r362733325
 
 

 ##########
 File path: src/chart/helper/labelHelper.js
 ##########
 @@ -25,7 +25,8 @@ import {retrieveRawValue} from 
'../../data/helper/dataProvider';
  * @return {string} label string. Not null/undefined
  */
 export function getDefaultLabel(data, dataIndex) {
-    var labelDims = data.mapDimension('defaultedLabel', true);
+    var dataDimsLen = data.dimensions.length;
+    var labelDims = data.mapDimension(dataDimsLen > 2 ? 
data.dimensions[dataDimsLen - 1] : 'defaultedLabel', true);
 
 Review comment:
   @100pah It's a change since we introduced `encode` in 4.0 . It breaks all 
`scatter` series. Not only the `bmap` one. 
   
   In the 3.x version and earlier. We use the first two values to represent the 
coordinates and the third one as the value. It will be displayed in the label 
and tooltip.
   
   In the logic of 
https://github.com/apache/incubator-echarts/blob/master/src/data/helper/dimensionHelper.js#L53
 . I think the third value should be an extra dimension besides [x, y] coords. 
But I'm not sure why the label still using the `y` value.

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


With regards,
Apache Git Services

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

Reply via email to