Jquery 简易饼图零百分比渲染为点?
当我尝试使用0%的简易饼图时,我仍然看到在顶部/12点钟位置呈现一个小点 参见屏幕截图。下面是HTML/JS/CSS 知道我做错了什么吗 HTML: CSS:Jquery 简易饼图零百分比渲染为点?,jquery,css,Jquery,Css,当我尝试使用0%的简易饼图时,我仍然看到在顶部/12点钟位置呈现一个小点 参见屏幕截图。下面是HTML/JS/CSS 知道我做错了什么吗 HTML: CSS: 你没有做错什么。我不知道其中是否有一个是你的,但有好几个 插件画了一条线。在本例中,它在0处开始一条线,在0处结束,并应用一个3px厚的笔划,笔划的端盖为圆形,在起点处创建一个小点 在代码中,您可以只检查值是否大于0,而完全不显示它,或者在GH上插话并等待修复。您可以设置barColor=trackColor: $(document).
你没有做错什么。我不知道其中是否有一个是你的,但有好几个 插件画了一条线。在本例中,它在0处开始一条线,在0处结束,并应用一个3px厚的笔划,笔划的端盖为圆形,在起点处创建一个小点
在代码中,您可以只检查值是否大于0,而完全不显示它,或者在GH上插话并等待修复。您可以设置
barColor=trackColor
:
$(document).ready(function(){
var charts = $('.percentage');
charts.easyPieChart({
animate: 1000,
onStep: function(value) {
this.$el.find('span').text(~~value);
if(this.percentage == 0)
this.options.barColor = this.options.trackColor;
},
});
});
$('.chart').easyPieChart({
animate: 2000,
scaleColor: false,
lineWidth: 12,
lineCap: 'square',
size: 100,
trackColor: '#e5e5e5',
barColor: '#00FF00',
onStep: function(from, to, percent) {
$(this.el).find('.percent').text(Math.round(percent));
}
});
.chart {
position: relative;
display: inline-block;
width: 110px;
height: 110px;
margin-top: 50px;
margin-bottom: 50px;
text-align: center;
}
.chart canvas {
position: absolute;
top: 0;
left: 0;
}
.percent {
display: inline-block;
line-height: 110px;
z-index: 2;
}
.percent:after {
content: '%';
margin-left: 0.1em;
font-size: .8em;
}
$(document).ready(function(){
var charts = $('.percentage');
charts.easyPieChart({
animate: 1000,
onStep: function(value) {
this.$el.find('span').text(~~value);
if(this.percentage == 0)
this.options.barColor = this.options.trackColor;
},
});
});