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_r363202621
 
 

 ##########
 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:
   > encode is not necessary in dataset case.
   
   I mean encode is a very common used concept and configuration in the scene 
using dataset.  It's necessary when we want to use another dimension to 
represent the value besides the `x/y` dimension. 
   
   But in the code without `dataset`, which is more common in our examples. 
It's not necessary to use encode to specify the value dimension in our earlier 
version. That's why our examples are broken.
   
   > when we guessing which dimension can be the "default label", we detect 
that if the data is from dataset, use the current way, otherwise, if the data 
is from series itself (that means the data will not shared by other series), 
use the laster dimension as the label.
   
   Perhaps it can solve the issue. Can you show a possible code to achieve this?
   
   I think the key issue is how to deal with the data from series and data from 
`dataset`. It seems currently we use the same encoding strategy on them. But 
they are different because data from `dataset` can be shared by different 
series.
   
   So can we solve it by using the dimension that has not been encoded yet?
   

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