pie-chart

How to avoid labels overlapping in a D3.js pie chart?

丶灬走出姿态 提交于 2019-11-29 03:50:06
问题 I'm drawing a pie chart using D3.js with a quite simple script. The problem is that when slices are small, their labels overlap. What options do I have to prevent them from overlapping? Does D3.js have built-in mechanisms I could exploit? Demo: http://jsfiddle.net/roxeteer/JTuej/ var container = d3.select("#piechart"); var data = [ { name: "Group 1", value: 1500 }, { name: "Group 2", value: 500 }, { name: "Group 3", value: 100 }, { name: "Group 4", value: 50 }, { name: "Group 5", value: 20 }

How to create pie chart in iPhone? [closed]

倾然丶 夕夏残阳落幕 提交于 2019-11-29 02:46:48
I want to show pie chart of my category by percentage. How can I create pie chart of category percentage ? Rama Rao There is API by that you can do this thing. MIMChart CorePlot Effective but not handy library. You have to implement a class which overrides the drawRect: method and draw the pie yourself. You'd use UIBezierPath class, specifically look into the addArcWithCenter:radius:startAngle:endAngle:clockwise: method to draw a part of a circle. See also this article and this article . This might be helpful with the warning that if it looks like someone else's code, it's because I worked out

Flot pie chart gives error in firebug: “uncaught exception: Invalid dimensions for plot, width = null, height = null”

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-29 01:40:24
问题 I using flot pie chart for plotting pie charts. but it shows error in firebug that uncaught exception: Invalid dimensions for plot, width = null, height = null I have given the height and width from stylesheet also. and tried also like this <div id="placeholder1" style="width:140px;height:140px" ></div> how to resolve this? 回答1: Check these: You include the jQuery library first and then flot js library Wrap the whole code within $(document).ready() handler function. you bind the flot with

Show Pie chart in Android Application [closed]

我的未来我决定 提交于 2019-11-28 23:09:40
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . I want to show pie chart in my android application like below: So any one idea about this how can I achieve this? If any library for that then please suggest me. Thank in advance. 回答1: In order to show different types of chart,you can use AchartEngine library available in Android or Google charts API here Kindly

Matplotlib pie-chart: How to replace auto-labelled relative values by absolute values

天大地大妈咪最大 提交于 2019-11-28 21:37:09
I'm creating a pie-chart according to the matplotlib-demo: https://matplotlib.org/1.2.1/examples/pylab_examples/pie_demo.html The percentage of each frac seems to be auto-labelled. How can I replace these auto-labelled relative values (%) plotted on the pie-chart by absolute values from fracs[] ? help(pie) says: *autopct*: [ *None* | format string | format function ] If not *None*, is a string or function used to label the wedges with their numeric value. The label will be placed inside the wedge. If it is a format string, the label will be ``fmt%pct``. If it is a function, it will be called.

How can i display pie chart in jsp page?

回眸只為那壹抹淺笑 提交于 2019-11-28 13:11:13
<%@page contentType="text/html" pageEncoding="UTF-8"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <%@ page import="java.awt.*"%> <%@ page import="java.io.*"%> <%@ page import="org.jfree.chart.*"%> <%@ page import="org.jfree.chart.entity.*"%> <%@ page import="org.jfree.data.general.*"%> <% DefaultPieDataset pieDataset = new DefaultPieDataset(); pieDataset.setValue("JavaWorld", new Integer(75)); pieDataset.setValue("Other", new Integer(25)); JFreeChart chart = ChartFactory.createPieChart("Sample Pie Chart",pieDataset,true,true,false); %

faceted piechart with ggplot2

こ雲淡風輕ζ 提交于 2019-11-28 12:58:33
I've done a faceted piechart with ggplot2 like this: qplot(x=factor(1), data=mtcars, fill=factor(cyl)) + geom_bar(width=1) + coord_polar(theta="y") + facet_grid(~gear) but as all the piecharts share the y axis scale, some of them doesn't cover the full circle. I've tried with facet_grid(~gear, scales="free") but it doesn't work. How could I get full circles for all the piecharts? I think you just want position = 'fill' : ggplot(mtcars,aes(x = factor(1),fill=factor(cyl))) + facet_wrap(~gear) + geom_bar(width = 1,position = "fill") + coord_polar(theta="y") For future reference, from the Details

How to set export csv option to button in google visualization Pie chart

风格不统一 提交于 2019-11-28 12:07:28
问题 I am using Google visualization pie chart for showing transaction state. I want to export to csv, there is functionality ToolBar to export csv,html,iGoogle but I want to specific to csv only without select options. 回答1: you can use static method --> dataTableToCsv google.visualization.dataTableToCsv this will create a csv string of the data in a data table. it will not export the column headings, but those can be added manually... see following working snippet... google.charts.load('current',

Adding percentage labels on pie chart in R

纵饮孤独 提交于 2019-11-28 11:38:25
My data frame looks like df Group value 1 Positive 52 2 Negative 239 3 Neutral 9 I would like to make a pie chart of the data frame using ggplot. pie <- ggplot(df, aes(x="", y=value, fill=Group)) + geom_bar(width = 1, stat = "identity") + coord_polar("y", start=0) This is my pie chart. But when I try to add percentage labels on the chart pie <- ggplot(df, aes(x="", y=value, fill=Group)) + geom_bar(width = 1, stat = "identity") + coord_polar("y", start=0) + geom_text(aes(y = value/2 + c(0, cumsum(value)[-length(value)]), label = percent(value/300 )), size=5) This is my result. I have already

how to add legend to a pie chart using D3js? And how to centralise the pie chart?

让人想犯罪 __ 提交于 2019-11-28 11:30:23
<script type="text/javascript"> var w = 400, //width h = 400, //height r = 150, //radius color = d3.scale.category20c(); //builtin range of colors data = [ {"label":"Single", "value":<?php echo $PercentageSingle; ?>}, {"label":"In a relationship", "value":<?php echo $PercentageInRe; ?>}, {"label":"Engaged", "value":<?php echo $PercentageEngaged; ?>}, {"label":"Married", "value":<?php echo $PercentageMarried; ?>}, {"label":"In an open relationship", "value":<?php echo $PercentageInOpenRe; ?>}, {"label":"It's complicated", "value":<?php echo $PercentageCom; ?>}, {"label":"Separated", "value":<