You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by GitBox <gi...@apache.org> on 2021/10/08 05:53:43 UTC

[GitHub] [echarts] Ovilia commented on issue #15832: Render custom bar plot with log scale

Ovilia commented on issue #15832:
URL: https://github.com/apache/echarts/issues/15832#issuecomment-938364879


   It should be 
   
   ```js
   renderItem: function (params, api) {
       var yValue = api.value(2);
       var start = api.coord([api.value(0), yValue]);
       var x = start[0]
       var y = start[1]
       var size = api.size([api.value(1) - api.value(0), yValue]);
       return {
       type: "rect",
       shape: {
           x: x,
           y: y,
           width: size[0],
           height: size[1]
       },
       style: api.style(),
       };
   },
   ```
   
   According to [api.size](https://echarts.apache.org/en/option.html#series-custom.renderItem.arguments.api.size), you should not omit the second parameter for log axis.
   
   > In some coordinate systems (for example, polar) or when log axis is used, the size is different in different point. So the second parameter is necessary to calculate size on the given point.
   


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

To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org