100pah commented on issue #9898: The series.label.formatter function passes in 
data from the wrong series. 
URL: 
https://github.com/apache/incubator-echarts/issues/9898#issuecomment-466808962
 
 
   @kevinw0123 
   
   I think it will make it more clearly if change the demo to be:
   
   ```js
   formatter: function (component) {
       // console.log(component);
       // var i = component.dataIndex+1;
       return component.value.join('||'); // print all content of value.
   }
   ```
   
   When using `seriesLayoutBy: 'row'`, each row of the `dataset.source` is 
mapped to a series, and each column is a "data item", which is exactly the 
"component.value" above.
   
   So in the first series, the formatter should be: 
   ```js
   formatter: function (component) {
       return component.value[1];
   }
   ```
   while in the second series, the formatter should be:
   ```js
   formatter: function (component) {
       return component.value[2];
   }
   ```
   
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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