DavidMarquezF commented on issue #17210:
URL: https://github.com/apache/echarts/issues/17210#issuecomment-1156631773

   I found a workaround but it is a **VERY DIRTY WORKAROUND**. It is prone to 
break in the future and it just hurts my eyes to look at it in my code, but it 
works 😁
   
   I found it looking at the source code:
   
https://github.com/apache/echarts/blob/1047e897b90fe250f89a369e3646a7fbbfdc2b35/src/chart/bar/BarView.ts#L1119-L1123
   
   So basically I do the same they do to calculate the barWidth. Maybe there is 
better way of getting the bar width, but for now I just found this.
   
   After calling `setOption` or `resize`:
   
   ```js
   const barSize = 
this.echart["_chartsViews"][0]["_model"].getData().getLayout("size");
   
       const sizeOption: ECOption = {
         series: [
           {
             id: this.MAIN_SERIES_ID,
             markPoint: {
               symbolSize: [barSize, 3]
             }
           }
         ]
       };
   this.echart.setOption(sizeOption);
   ```
   
   I'm accessing at the chartsView index 0 because I know I have my 
BarChartView, but you should put the index of your bar dataset I guess.
   
   Again, this is just dirty and not a good fix, but I guess it will just work 
until echarts provides a proper solution


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to