pie-chart

Matlab: Explicitly specifying pie graph slice color

巧了我就是萌 提交于 2019-12-10 14:19:40
问题 I'm creating a pie graph. pie([a,b,c,d]); Is it possible to explicitly change the color of the individual slices? For example; if I wanted the slices for a and b to always be green and c and d to always be blue, regardless of their size, how would I do that? It seems to me that a color map shades using the size of the slice not necessarily the order in which it was given to the pie function. 回答1: The colors of the pie are determined by the axis colormap. So define a matrix with as many rows

Adjusting figure margins in Rmarkdown

穿精又带淫゛_ 提交于 2019-12-10 13:54:27
问题 I am trying to adjust the piechart figure in my Rmarkdown document so that it spans the width of the page or at least becomes wide enough to fit all of the labels. I have tried everything - adjusting figure.height and figure.width , margins with par(mar) and par(oma) , but nothing seems to work. Either the pies themselves become smaller, or the labels are even more cut off. I would like the pies to be as large as possible with clearly visible labels, but every time it renders small pies and

JqPlot Pie Chart - Change Pie Slice Colors

淺唱寂寞╮ 提交于 2019-12-10 13:43:37
问题 I have a pie chart displaying using JqPlot. I would be interested in changing the actual colors of the slice, and have had no luck so far. I came across this link and tried the solution, but I'm not sure if I'm putting it in the wrong place (Have tried inserting it in a few locations in the code) as when I have it in, the pie chart no longer displays (and in fact stops the rest of the charts on the page from displaying). Here is the javascript code for the pie chart: $(document).ready

Display percentage values on a pie chart [duplicate]

别等时光非礼了梦想. 提交于 2019-12-10 12:27:26
问题 This question already has answers here : ggplot, facet, piechart: placing text in the middle of pie chart slices (4 answers) R + ggplot2 => add labels on facet pie chart [duplicate] (1 answer) Closed 3 years ago . I am trying to draw a pie chart with ggplot2. My code is shown below. df <- data.frame( variable = c("australia","hungary","germany","france","canada"), value = c(632,20,491,991,20) ) ggplot(df, aes(x = "", y = value, fill = variable)) + geom_bar(width = 1, stat = "identity") +

How to make my chartData dynamic using my valid local file(json)?

↘锁芯ラ 提交于 2019-12-10 12:05:50
问题 I have a pieChart(sample working link below), but what I want is to get my chartData from my local file so it would not be hard coded. I'm having difficulty in this one. Note that I have valid JSON file, which I test and it works. When I did is to assign my JSON file to the var chartData = "validJsonFile.json" , it is not working. my chart displays nothing at all. I hope someone can help me. Thanks. Sample Working ChartLink is here the thing i tried but didnt work: var chartData =

add an image for each slice in iOS-chart pieChart

假装没事ソ 提交于 2019-12-10 10:44:01
问题 I'm using ios-charts. I want to create a pie chart like below image. I have done all the confings, but I have problem with adding the image in the circle beside the values outside the circle. Can anybody help me how to to add the circles and image inside it ? UPDATED : note that the pie chart will scroll and those images should scroll with the related slices. UPDATED : I used @Aditya Garg sample code to draw images beside the position of labels, and my chart is now looks like this : I set the

How to display Text on a PieChart?

泪湿孤枕 提交于 2019-12-10 10:43:23
问题 I have Created a PieChart Using the following Code. Here, I Have taken the sum of x and y as 100% to display the x% as red color and y% as green color on pieChart. On the red color i want to display the exact x% (Example 45% (or) 55% ) and on the green color i want to display the exact y% (Example 55% (or) 45% ). In my application the X and Y values are Variables. Those Values are changing each time when i run my application. I want to display the pieChart with green and red colors with the

How to set chart type to pie

两盒软妹~` 提交于 2019-12-10 04:10:29
问题 When I do it without putting chart type is working fine but when I set it to pie its not working correct. It put all series name as Point 1 the pie is only 1 blue piece (one circle) and it show only first point (Value). foreach (var tag in tags) { HtmlNode tagname = tag.SelectSingleNode("a"); HtmlNode tagcount = tag.SelectSingleNode("span/span"); chart1.Series.Add(tagname.InnerText); chart1.Series[x].Points.AddY(int.Parse(tagcount.InnerText)); chart1.Series[x].IsValueShownAsLabel = true;

Pie (donut) chart segment order in D3

心不动则不痛 提交于 2019-12-08 15:38:27
问题 I have a donut chart built using d3 with a jQuery slider that allows a user to select between different data-points. The chart animates the transition between data values and all is well. The problem: The segments always render in anti-clockwise size order (from largest to smallest). This means that segments switch their position around the chart depending on their size. This behaviour is confusing for users, but unfortunately I can't work out how to change it. I would like the segments to

D3 Multiple Pie Chart Updates

人盡茶涼 提交于 2019-12-08 09:27:09
问题 I am quite new to D3 but have been working through some mbostocks examples but hitting an issue when trying to update multiple pie charts. I can generate these fine from my data array but when I want to update them I run into an issue. The issue is quite simple but I am a little stuck on how to fix this. I have run up my code in js fiddle that can be found here. You will see that in my example I build three pies, then wait 3 seconds and update these to new data. The issue I have is that all