简体   繁体   English

如何在 highcharts 中设置堆叠条的边框半径

[英]how to set border radius for stacked bar in highcharts

Hi I am trying to set border radius for stacked bar with two items using嗨,我正在尝试使用两个项目为堆叠条设置边框半径

borderRadiusTopLeft: '50%', borderRadiusTopRight: '50%', borderRadiusBottomLeft: '50%', borderRadiusBottomRight: '50%', borderRadiusTopLeft:'50%',borderRadiusTopRight:'50%',borderRadiusBottomLeft:'50%',borderRadiusBottomRight:'50%',

which is working good if both the values are >1如果两个值都> 1,则效果很好

issue is when one of the value is 0问题是当其中一个值为 0

I need both sides with radius even if values is 0,即使值为0,我也需要半径的两边,

Please find the attachment for graph.请找到图表的附件。

can someone help me please.有人能帮助我吗。

在此处输入图像描述

Try setting the parent's border-radius , this works for me:尝试设置父母的border-radius ,这对我有用:

 .bar { width: 200px; height: 20px; display: flex; align-items: stretch; border-radius: 6px; overflow: hidden; }.bar > * { color: white; display: flex; align-items: center; justify-content: center; }.red { background-color: #E37273; flex: var(--red); }.blue { background-color: #29D0CE; flex: var(--blue); }
 <div class="bar" style="--red: 0; --blue: 8;"> <span class="red"></span> <span class="blue">8</span> </div> <br> <div class="bar" style="--red: 5; --blue: 3;"> <span class="red">5</span> <span class="blue">3</span> </div> <br> <div class="bar" style="--red: 8; --blue: 0;"> <span class="red">8</span> <span class="blue"></span> </div>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM