pie-chart

adding tooltips to pie chart using d3.js

廉价感情. 提交于 2019-11-28 11:28:43
I am embarking on a journey to learn to visualize data using d3.js, and so far I am finding the "Interactive Data Visualization" by Scott Murray very helpful. I was following through some of the example codes in book chapter 11, and was wondering how I would add the tooltip to the pie chart (the book already describes this procedure using the bar chart). Anyways, just been tinkering around with the codes for past couple of hours and would like to see if anyone can lend me a hand on this: <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>D3: Pie layout</title> <script type=

How to add a legend to matplotlib pie chart?

旧街凉风 提交于 2019-11-28 10:16:24
Using this example http://matplotlib.org/examples/pie_and_polar_charts/pie_demo_features.html how could I add a legend to this pie chart? My problem is that I have One big slice 88.4%, the second largest slice is 10.6%, and the other slices are 0.7 and 0.3%. The labels around the pie don't appear (except for the biggest slice) and neither the percentage values for the smaller slices. So I guess I can add a legend showing the names and the values. But I haven't found out how... # -*- coding: UTF-8 -*- import matplotlib.pyplot as plt # The slices will be ordered and plotted counter-clockwise.

Problems with legend in Core-Plot (pieChart)

风流意气都作罢 提交于 2019-11-28 09:41:22
问题 I have a problem drawing the legend of a pieChart with Core-Plot, because the name of each element of the chart in the legend is always the identifier of the CPTPieChart. Can someone help me? Thanks. This is the source code: -(void)constructPieChart { // Create pieChart from theme //[pieGraph applyTheme:theme]; pieChartView.hostedGraph = pieGraph; pieGraph.plotAreaFrame.masksToBorder = YES; pieGraph.paddingLeft = 0; pieGraph.paddingTop = 20.0; pieGraph.paddingRight = 0; pieGraph.paddingBottom

Multiple pie-charts in the same chart with HighCharts

两盒软妹~` 提交于 2019-11-28 06:40:33
问题 I'm trying to draw multiple pie-charts in the same chart with HighCharts . JSFIDDLE DEMO I have enabled the legend for each pie-chart. Now two legends for the 2 charts are shown at the bottom ( notice that 2 items for each entry are visible in the legend ). When I click on an item of the legend it shows/hides a piece in one pie-chart... But I want to achieve either of followings, I want to have a single legend for both charts so that relevant piece of both pie-charts disappears/appears when I

Making a scatter plot of multiple pie charts of differing sizes, using ggplot2 in R

和自甴很熟 提交于 2019-11-28 06:13:44
问题 I have a data frame containing the following data: > data_graph # A tibble: 12 x 4 # Groups: ATTPRO, ATTMAR [?] x y group nb <dbl> <dbl> <chr> <int> 1 0 0 1 1060 2 0 0 2 361 3 0 0 3 267 4 0 1 1 788 5 0 1 2 215 6 0 1 3 80 7 1 0 1 485 8 1 0 2 168 9 1 0 3 101 10 1 1 1 6306 11 1 1 2 1501 12 1 1 3 379 My objective is to have the following chart: Both x and y , qualitative variables, to be put as X/Y axis nb , quantitative variable, representing pie size group , qualitative variable, representing

Preventing overlap of text in D3 pie chart

安稳与你 提交于 2019-11-28 03:36:20
问题 I've been googling around, but I can't seem to grasp this. My situation is that the countries overlap when presented on the pie chart: This is an example of what is happening: jsfiddle I am a total beginner to D3 and am trying to prevent text overlap. Is there like a text margin attribute that I can add such that my labels don't overlap each other? 回答1: Update : See the answer to D3 put arc labels in a Pie Chart if there is enough space for a more comprehensive solution. I do not know any

beautiful Pie Charts with R

穿精又带淫゛_ 提交于 2019-11-28 03:24:48
Let's say I have this simple data: mydata <- data.frame(group=c("A", "B", "0", "AB"), FR=c(20, 32, 32, 16)) If I want to create a pie chart from this dataframe I can do: with(mydata,pie(FR, labels=paste0(as.character(group), " ", FR, "%"), radius=1)) It's quite simple but acceptable. How can I get something similar with ggplot2 or lattice? After much trial and error I've got ggplot(mydata, aes(x = factor(1), y=FR,fill=factor(group)) ) + geom_bar(width = 1,stat="identity")+coord_polar(theta = "y") It's much more complex and ugly. Isn't it supposed to be easy? ggplot books only give some

Plotting Pandas DataFrames in to Pie Charts using matplotlib

雨燕双飞 提交于 2019-11-28 01:05:19
问题 Is it possible to print a DataFrame as a pie chart using matplotlib? This has instructions for plotting lot of chart types including bar, histogram, scatter plot etc. But pie chart is missing? 回答1: import matplotlib.pyplot as plt plt.pie(DataFrame([1,2,3])) seems to work as expected. If the DataFrame has more than one column, it will raise. 回答2: Pandas has this built in to the pd.DataFrame.plot() . All you have to do is use kind='pie' flag and tell it which column you want (or use subplots

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

不打扰是莪最后的温柔 提交于 2019-11-27 21:02:07
问题 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[] ? 回答1: 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

How to create pie chart in iPhone? [closed]

不打扰是莪最后的温柔 提交于 2019-11-27 17:19:25
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 7 years ago . I want to show pie chart of my category by percentage. How can I create pie chart of category percentage ? 回答1: There is API by that you can do this thing. MIMChart CorePlot Effective but not handy library. 回答2: