pie-chart

How do I externalize my d3 v4 pie chart labels?

[亡魂溺海] 提交于 2019-11-29 15:57:50
I'm using d3 v4. I want to move tabels out of my pie chart and have them point at the pie chart instead (because for small wedges it is not possible to read the labels). I thought this would add external labels // Now we'll draw our label lines, etc. enteringLabels = labels.selectAll(".label").data(data).enter(); labelGroups = enteringLabels.append("g").attr("class", "label"); labelGroups.append("circle").attr({ x: 0, y: 0, r: 2, fill: "#000", transform: function (d, i) { centroid = pied_arc.centroid(d); return "translate(" + pied_arc.centroid(d) + ")"; }, 'class': "label-circle" }); but the

Highcharts pie tooltip cuts off

大兔子大兔子 提交于 2019-11-29 15:39:13
I am using Highcharts to generate a pie chart. It is generating it fine but the problem is that I have a fixed area to display the chart and the tooltip has large amount of text. The tooltip is too large to fit inside the chart div, how can I fix this? $(function () { var chart; $(document).ready(function () { chart = new Highcharts.Chart({ chart: { renderTo: 'ER_inpatient_stay', plotBackgroundColor: null, plotBorderWidth: null, marginTop: 0, plotShadow: false, backgroundColor: 'none', }, legend: { layout: 'vertical', align: 'left', borderColor: '#fff', itemMarginTop: 30, verticalAlign: 'top',

click event on pie chart in android [closed]

独自空忆成欢 提交于 2019-11-29 14:45:02
问题 This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center. Closed 7 years ago . I have used to draw pie chart using canvas.. There are approximately 10 arcs in pie chart..i want to perform click event on each arc. Is there any way to

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

对着背影说爱祢 提交于 2019-11-29 12:45:29
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 pie parts The best result approching this using ggplot2 package is only giving me bubbles, with this

Changing the radius of a coord_polar ggplot

為{幸葍}努か 提交于 2019-11-29 10:41:32
I'm looking to reduce the display radius of a pie chart built in ggplot2 relative to the rest of the plot (as the defaults keep cutting off my category labels). Here's some dummy data and code that should show you what I'm experiencing: library(ggplot2) library(scales) library(grid) Region <- c("North America", "Central America", "South America", "Carribbean", "Western Africa", "Northern Africa", "Southern Afica", "Eastern Africa") Conti <- c(rep("Americas",4), rep("Africa",4)) Freq <- c(runif(8, 1, 100)) Pct <- c(Freq/sum(Freq)) Pos <- c(cumsum(360*Pct)-(360*Pct/2)) Pos <- c(ifelse(Pos<=180

Preventing overlap of text in D3 pie chart

那年仲夏 提交于 2019-11-29 10:15:47
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? musically_ut 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 generic method of laying text elements such that they do not overlap. However, there is a

Plotting Pandas DataFrames in to Pie Charts using matplotlib

南笙酒味 提交于 2019-11-29 07:24:13
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? 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. cmgerber 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=True to get all columns). This will automatically add the labels for you and even do the percentage labels

How to add Percentage and Total on the Legend of Google Pie Charts

坚强是说给别人听的谎言 提交于 2019-11-29 06:22:36
I have a page that displays data in a form of a Pie Chart. I use Google Charts to do this. Here's the code: <script type="text/javascript" src="https://www.google.com/jsapi"></script> <script type="text/javascript"> google.load("visualization", "1", {packages:["corechart"]}); google.setOnLoadCallback(drawChart); function drawChart() { var data = google.visualization.arrayToDataTable([ ['Goal Name', 'No. of times Requested'], ['Frank.net Life Cover', 226], ['Frank.net Hospital Cash Back', 147], ['Frank.net Salary Protection', 228], ['King Price Car Insurance', 328], ['Momentum Medical Aid', 493

Displaying decimal places on primefaces pie chart

假如想象 提交于 2019-11-29 05:19:59
I would like to check how do I display decimals for primefaces ver 3.3 pie chart label? Currently, there are two proportions in my chart. Label A and Label B. Label A has a very big number like 100000 but label B has 100. Therefore, in the pie chart, Label A is not 100%. However, primefaces converts this to 100% which is wrong. Is there any way I can show the decimal places instead of whole numbers as labels on the pie chart? Define an extender function like: function ext() { this.cfg.seriesDefaults.rendererOptions.dataLabelFormatString = '%.4s%%'; this.cfg.seriesDefaults.rendererOptions

HighCharts Pie Chart - Add text inside each slice

限于喜欢 提交于 2019-11-29 04:32:41
I am creating a financial pie chart using HighCharts that represents asset allocation. My goal is to create a chart that represents the actual allocation values in each slice but inside each slide will show essentially a second data label that displays the target percentage for various investment vehicles. It is important to note that the current asset allocation may not always match up with the targeted allocation value. I have gotten everything working except for the Target labels inside each slide. See the image below for what I would like to accomplish: Here is what I have thus far: var