Tag: 饼图

jQuery flot pieresize

我有resize的工作,但是当我使用饼图时,每个人都是oke但是当我调整容器的大小时,我得到一个大的sqaure图表而不是圆形饼图。 这怎么可能解决? JS代码: $(“table.chart-pie”).each(function() { var colors = []; $(“table.chart-pie thead th:not(:first)”).each(function() { colors.push($(this).css(“color”)); }); $(this).graphTable({ series: ‘columns’, position: ‘replace’, width : ‘100%’, height: ‘250px’, colors: colors }, { series: { pie: { show: true, pieStrokeLineWidth: 0, pieStrokeColor: ‘#FFF’, radius: 100, label: { show: true, radius: 3/4, formatter: function(label, series){ return ”+label+’: ‘+Math.round(series.percent)+’%’; }, background: […]

检索raphael饼图的属性

如何获取raphael饼图的属性: 属性如:笔划,值(不带图例),半径,x和y位置 我的饼图定义为: pie = r.piechart(120, 140, 50, [55, 22], { colors: [“green”,”red”], stroke: “black” }); 我试过了: this.stroke – 说未定义 //我知道这对我来说是正确的raphael对象,因为我也做了一些工作 this.click(function () { alert(this.stroke); }); this.attr( ‘行程’); – 甚至不显示未定义 任何想法如何解决这个…谢谢

jqPlot饼图工具提示

我是否认为jqPlot中的Hightlighter类不处理PieRenderer的工具提示? 我花了很长时间试图让它们工作,但我似乎无法让它显示工具提示。 如果我是对的,有没有办法处理段的翻转并将数据传递给第三方jQuery工具提示? 谢谢。

带有向下钻取/可点击饼图部件的jquery饼图

我正在寻找一个JQuery插件来制作饼图,其中我可以点击楔形或切片,根据饼形楔形的值转到另一个页面。 我有一张饼图,上面有一个等级(AF)。 如果有人点击“A”楔子,我想重定向到显示A学生的页面。

如何用线条添加jqplot饼图标签?

我有一个饼图,我可以正常添加标签。但我想添加带有如下行的标签。 我以网络上的这张图片为例。 这是我的代码, drawPieCharts = function(dev,title,data){ $(‘#’+dev).empty(); var plot = $.jqplot(dev, [data], { title: { text: title, fontWeight: ‘bold’, fontSize : ’16’, show: true }, grid: { drawBorder: false, drawGridlines: false, background: ‘#ffffff’, shadow:false, //diameter : 30 }, axesDefaults: { }, highlighter: { show: true, formatString:’%s , P%’, tooltipLocation:’n’, useAxesFormatters:false }, seriesDefaults:{ renderer:$.jqplot.PieRenderer, rendererOptions: { […]

如何使用ChartJS中的溢出滚动修复图表图例宽度 – 高度

我想为我的项目创建饼图,所以我正在使用ChartJS,但是chartJS有一些问题,如果我使用10到20个数据字段,时间表看起来不错,但是当我申请更多时在一个图表中超过50到60个数据字段,因此该图表看起来更小而不是图例,并且如果有时数据字段太多而不是图表隐藏,则只能看到图例,图表消失了。 我想将高度或宽度设置为该图例,如果有更多数据,还应用于滚动条。 这是小提琴链接供您参考 https://jsfiddle.net/KDM1010/5um78rbk/ var ctx = document.getElementById(“myChart”).getContext(‘2d’); var myChart = new Chart(ctx, { type: ‘pie’, data: { labels: [“lable_1”, “lable_2”, “lable_3”, “lable_4”, “lable_5”, “lable_6”, “lable_7”, “lable_8”, “lable_9”, “lable_10”, “lable_11”, “lable_12”, “lable_13”, “lable_14”, “lable_15”, “lable_16”, “lable_17”, “lable_18”, “lable_19”, “lable_20”, “lable_21”, “lable_22”, “lable_23”, “lable_24”, “lable_25”, “lable_26”, “lable_27”, “lable_28”, “lable_29”, “lable_30”, “lable_31”, “lable_32”, “lable_33”, “lable_34”, “lable_35”, “lable_36”, […]

简单的饼图:错误百分比不居中?

我有一个symfony项目,我使用bootstrap作为样式,我想使用Easy Pie Chart作为仪表板页面。 所以,在base.html.twig中: {% block title %} Website {% endblock %} {% block stylesheets %}{% endblock %} {% block javascripts %} {% javascripts ‘js/jquery-1.10.2.min.js’ ‘js/bootstrap.min.js’ ‘js/typeahead.min.js’ ‘js/jquery.easypiechart.min.js’ ‘js/jquery.sparkline.min.js’ %} {% endjavascripts %} {% endblock %} {% block header %} {% endblock %} {% block body %} {% endblock %} {% block javascripts_after %} {% […]

D3.js:删除动态添加的饼图切片

我能够生成饼图并根据用户交互动态地向其添加数据。 这是小提琴http://jsfiddle.net/L5Q8r/ 我面临的问题是从饼图中删除数据。 取消选中该复选框后,我将从“数据集”中删除数据并更新图表。 图表正在更新,但用户仍然可以看到之前的“切片”。 我尝试添加“.exit()。remove()”但没有成功。 这是我做的: var updateChart = function (dataset) { arcs.data(pie(dataset)) .enter() .append(“path”) .attr(“stroke”, “white”) .attr(“stroke-width”, 0.8) .attr(“fill”, function (d, i) { return color(i); }) .attr(“d”, arc); arcs.data(pie(dataset)).exit().remove(); // Executing but not working arcs.transition() .duration(duration) .attrTween(“d”, arcTween); sliceLabel.data(pie(dataset)); sliceLabel.transition() .duration(duration) .attr(“transform”, function (d) { return “translate(” + (arc.centroid(d)) + “)”; }) .style(“fill-opacity”, […]

Raphael JS Pie:为路径切片添加ID

我在Raphael谷歌小组看过这个问题,但是在那里搜索了几个小时,还有谷歌,我似乎无法找到解决方案。 我只是希望能够使用jQuery定位我的饼图(svg路径)切片,但我无法弄清楚如何将自定义ID添加到路径标记 – 默认情况下没有ID属性: 什么是理想的将是这样的: 有谁知道如何实现这一目标? 这是我用来创建饼图的代码: window.onload = function () { var r = Raphael(“holder”); var pie = rgpiechart(350, 350, 256, [56, 104, 158, 23, 15, 6]); pie.hover(function () { this.sector.stop(); this.sector.animate({scale: [1.1, 1.1, this.cx, this.cy]}, 500, “bounce”); }, function () { this.sector.animate({scale: [1, 1, this.cx, this.cy]}, 500, “bounce”); }); }; 基本上,我需要能够做到这一点的原因是,我可以创建一些单独的锚点触发器来执行上面显示的缩放动画。 任何帮助非常感谢。

Jquery Flot饼图显示数据值而不是百分比

我无法弄清楚如何让flot.pie将标签中显示的数据从“原始数据”的百分比更改为实际数据。 在我的例子中,我创建了一个饼图,其中包含已读/未读消息的数量。 读取消息数:50。未读消息数:150。 创建的饼图显示读取消息的百分比为25%。 在这个位置,我想显示实际的50条消息。 见下图: 我用来创建馅饼的代码: var data = [ { label: “Read”, data: 50, color: ‘#614E43’ }, { label: “Unread”, data: 150, color: ‘#F5912D’ } ]; 和: $(function () { $.plot($(“#placeholder”), data, { series: { pie: { show: true, radius: 1, label: { show: true, radius: 2 / 3, formatter: function (label, series) […]