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_r363576700
 
 

 ##########
 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:
   > So can we solve it by using the dimension that has not been encoded yet?
   
    For example, If we have three value in each item of `series.data`.
   ```js
   [x, y, z]
   ```
   
   Because the data is not shared by other series. After taking `[x, y]` and 
encoded to xAxis/yAxis. We can easily guess the third value `z` is an extra 
value which can be displayed as label and tooltip.  We can treat it as a 
function `z = f(x, y)`
   
   But in the `dataset`, because each dimension may be taken by other series.  
We can not simply use the third dimension,  or the last dimension. So can we 
take a further step and find if any dimension in the `dataset` has been taken 
by other series and being encoded? 

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