arashdalir commented on issue #9429: need to get axisLabel.maxLabel
URL: 
https://github.com/apache/incubator-echarts/issues/9429#issuecomment-440314865
 
 
   thanks @sxmpasch. tbh didn't notice the `getHeight()` function and didn't 
know exactly how the `convertFromPixel` works. this is working for now, I have 
not checked all the chart types in our system though; would report back if 
there are any other issues.
   
   > @arashdalir - ok, percentage to absolute pixel. You just have to calculate 
this against the total height of the echarts instance:
   > 
   > ```
   >                     let topPixel=myChart.getOption().grid[1].top
   >                     if (topPixel.indexOf('%')>=0) {
   >                         topPixel=topPixel.substr(0,topPixel.length-1);
   >                         
topPixel=parseInt(topPixel)/100*myChart.getHeight();
   >                     }
   >                     console.log(topPixel)
   >                     let 
coord=myChart.convertFromPixel({seriesIndex:0},[0,topPixel]);
   >                     console.log(coord[1]);                    
   > ```
   

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