[英]Jquery Pie chart with inner circle
For an project i need to realise an chart with two circles. 对于一个项目,我需要实现一个带有两个圆圈的图表。 It need to looks like this one: 它需要看起来像这样一个:
Is there an Jquery solution that support this? 是否有支持此的Jquery解决方案? I already tried with Jqplot but with that plug-in i can't succeed to create something like this. 我已经尝试过使用Jqplot,但是使用该插件我无法成功创建类似的东西。 I tried with this code: 我尝试使用以下代码:
// Create chart
var plot1 = $.jqplot('pie_chart', [s2,s1], {
seriesDefaults: {
renderer:$.jqplot.DonutRenderer,
rendererOptions:{
startAngle: -90,
showDataLabels: true,
dataLabels: 'value',
innerDiameter :0,
padding:5,
highlightMouseOver:false
}
}
});
//Theming based in the rendered module items in the HTML
temp = {
seriesStyles: {seriesColors: array2},
grid: {
backgroundColor: 'rgba(0,0,0,0)',
borderWidth: 0,
shadow: false
}
};
plot1.themeEngine.newTheme('uma', temp);
plot1.activateTheme('uma');
But the colors are for the inner and outer ring the same and create something like this: 但是内圈和外圈的颜色相同,并创建如下所示的内容:
The settings for the style are for the inner and outer ring. 样式的设置适用于内圈和外圈。 In my case i need to give the outer ring an different style. 就我而言,我需要给外圈一个不同的样式。
Can i use this plug-in or do i need to use an other Jquery plug-in to realise my chart? 我可以使用此插件还是需要使用其他Jquery插件来实现图表?
I found an solution wich works with d3.js ( http://d3js.org/ ): 我发现一个可以与d3.js( http://d3js.org/ )一起使用的解决方案:
http://bl.ocks.org/mbostock/4063423 http://bl.ocks.org/mbostock/4063423
Works fine for me! 对我来说很好! Currently looks like this: 目前看起来像这样:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.