pie-chart

Putting two Pie Charts in one

↘锁芯ラ 提交于 2020-02-20 05:17:26
问题 I am trying to create a pie chart with my following data in R: 2009 2010 US 10 12 UK 13 14 Germany 18 11 China 9 8 Malaysia 7 15 Others 13 15 The command I am using is: slices<-c(10,13,18,9,7,13,12,14,11,8,15,15) lbls <- c("US","UK","Germany","China", "Malaysia", "Others","US","UK","Germany","China", "Malaysia", "Others") pct <- round(slices/sum(slices)*100) lbls <- paste(lbls,"%",sep="") lbls <- paste(lbls, pct) pie(slices,labels = lbls, col=rainbow(length(lbls)), main="Pie Chart of

Matplotlib pie/donut chart annotation text size

こ雲淡風輕ζ 提交于 2020-01-25 08:22:10
问题 For the code given below to create a donut chart from matplotlib official page(https://matplotlib.org/3.1.1/gallery/pie_and_polar_charts/pie_and_donut_labels.html) recipe = ["225 g flour", "90 g sugar", "1 egg", "60 g butter", "100 ml milk", "1/2 package of yeast"] data = [225, 90, 50, 60, 100, 5] wedges, texts = ax.pie(data, wedgeprops=dict(width=0.5), startangle=-40) bbox_props = dict(boxstyle="square,pad=0.3", fc="w", ec="k", lw=0.72) kw = dict(arrowprops=dict(arrowstyle="-"), bbox=bbox

Dynamically update a pie chart in an Observer?

情到浓时终转凉″ 提交于 2020-01-25 07:22:06
问题 I am using pie chart to display some statistics in a JFrame using JFreeChart package. I am using the PieDataset to be passed to the createChart method. Also, the datatset is set to update dynamically, as I am using the observer pattern in my application, which I thoroughly debugged. My issue is that in spite of being able to update the datatset dynamically, the piechart on the frame does not update as it is, maybe not able to take the new (updated) values and display the result. I would like

Slice values are getting wiped out after refreshing Pie chart

无人久伴 提交于 2020-01-25 06:39:09
问题 I am using below code to populate slice values in a pie chart using JS and it's correctly working but I am observing another problem as these values are getting populated only once and when I reload the charts it's getting disappeared. Now let's say if I close the browser and open again or change the browser it will show values again. But after doing multiple force refresh Ctrl + F5 then also it's not showing the values. Could you please help? Please note I am having more than 3 pie charts on

D3.js pie chart labels for slices not tweening

旧城冷巷雨未停 提交于 2020-01-25 04:48:05
问题 When I click on the various hyperlinks to tween my chart: while the pie's slices are tweening but I cannot figure out how to bring along each slice's label. A mostly working JSfiddle is here: http://jsfiddle.net/lukateake/MX7JC/ Thanks in advance for any insights you can provide me. I promise to update the fiddle with whatever solution we discover as I imagine this effect is of interest to a great many D3'ers. 回答1: The main issue here is in your updateChart function - while you rebound the

Pie chart with label shown inside and percentage shown outside the pie

一世执手 提交于 2020-01-24 23:59:11
问题 I have data like this and I need to draw the pie chart: # Creat bar chart for jam language library("ggplot2") # Data visualization library("dplyr") # Data manipulation library("RColorBrewer") myPalette <- brewer.pal(5, "Set2") all_languages <- data.frame( Languages = c("English", "French", "Spanish", "Portuguese", "Others"), n = c(81, 4, 3, 2, 3), prop = c(87.1, 4.3, 3.2, 2.2, 3.2) ) # Add label position all_languages <-all_languages %>% arrange(desc(Languages)) %>% mutate(lab.ypos = cumsum(n

Two line title in google chart api

二次信任 提交于 2020-01-23 16:47:24
问题 I am using Google chart api to create a pie chart. What I want here is to display the title in two lines. One is the actual title and below that some info in small text. How can I achieve this? 回答1: So, just tried to get myself caught up on the API (guess they do this via javascript now and deprecated the image charts--good to know). Anyways... There's a page on Pie Chart options, but nothing specific to per-line. You can split lines using \n , but you're stuck with a uniform styling (via

Pie, bar, line: SVG/VML better than Canvas

旧街凉风 提交于 2020-01-22 17:47:52
问题 I need to choose a library for "standard" charting: pies, lines and bars. From what I've read, it seems to me that the best format is SVG/VML, like Highcharts for example. SVG is becoming standard across all major browsers, now that IE 9 accepts it. It seems easier to rescale and export than Canvas. Still, I see that several charting libraries rely on Canvas. Am I missing something? Is there any reason for considering Canvas over SVG for such applications? 回答1: You can generally achieve the

Pie, bar, line: SVG/VML better than Canvas

独自空忆成欢 提交于 2020-01-22 17:47:06
问题 I need to choose a library for "standard" charting: pies, lines and bars. From what I've read, it seems to me that the best format is SVG/VML, like Highcharts for example. SVG is becoming standard across all major browsers, now that IE 9 accepts it. It seems easier to rescale and export than Canvas. Still, I see that several charting libraries rely on Canvas. Am I missing something? Is there any reason for considering Canvas over SVG for such applications? 回答1: You can generally achieve the

Python matplotlib.pyplot pie charts: How to remove the label on the left side?

北战南征 提交于 2020-01-22 13:22:12
问题 I plot a piechart using pyplot. import pylab import pandas as pd test = pd.Series(['male', 'male', 'male', 'male', 'female'], name="Sex") test = test.astype("category") groups = test.groupby([test]).agg(len) groups.plot(kind='pie', shadow=True) pylab.show() The result: However, I'm unable to remove the label on the left (marked red in the picture). I already tried plt.axes().set_xlabel('') and plt.axes().set_ylabel('') but that did not work. 回答1: You could just set the ylabel by calling pylab