I too am trying to display the fractions on my pie chart without the added decimal place. Any progress on this? Thanks.
On Friday, September 4, 2015 at 1:44:16 PM UTC-4, [email protected] wrote: > > Please make this flexible so any number of decimal points are supported, > either specifically or though a format string. In my case, I wanted to > have zero decimal places. > > Thanks, > Spencer > > On Thursday, July 30, 2015 at 7:37:31 PM UTC-7, Daniel LaLiberte wrote: >> >> We haven't worked on this yet. (I've been focused on getting the frozen >> version 41 out, which it now is, so we'll be moving on to other issues.) >> >> Showing more digits of the percentage should help with adding up all of >> the slices closer to 100%. There is no way to get that value out now, >> though we'll keep that in mind for the future. >> >> Here is how the percentage value is calculated now, using the JavaScript >> Math.round function: >> >> Math >> <https://cs.corp.google.com/#piper///depot/google3/javascript/externs/es3.js&l=896&ct=xref_jump_to_def&cl=GROK&gsn=Math>.round >> >> <https://cs.corp.google.com/#piper///depot/google3/javascript/externs/es3.js&l=1017&ct=xref_jump_to_def&cl=GROK&gsn=round>(relativeValue >> >> <https://cs.corp.google.com/#piper///depot/google3/javascript/gviz/devel/canviz/pie-chart-definer.js&l=836&ct=xref_jump_to_def&cl=GROK&gsn=relativeValue> >> * 1000) / 10 + '%' >> >> >> On Wed, Jul 29, 2015 at 3:51 PM, Dan C <[email protected]> wrote: >> >>> Hi Daniel, >>> >>> When will this feature become available? I tried to explain to the >>> business that when % values are rounded up/down, there is no way it will >>> add up to 100%. Might be +/- 0.1%. However, if we can make it 2 decimal or >>> 3 decimal places, then the total should be a lot closer to 100%. Also, is >>> there a function that will expose the value of the % inside the legend? >>> >>> What rounding method is used for the pie chart? >>> >>> Thanks! >>> >>> On Wednesday, May 21, 2014 at 9:41:56 AM UTC-4, Daniel LaLiberte wrote: >>>> >>>> Ah, I should have noticed that you mentioned the percentage value. >>>> There is no way at this time to specify the format of the percentage >>>> value, >>>> though I can see it might be useful in some cases. We'll consider it for >>>> a >>>> feature enhancement. >>>> >>>> >>>> On Wed, May 21, 2014 at 8:44 AM, Mahmoud Said <[email protected]> >>>> wrote: >>>> >>>>> Thank you Daniel, you are right, i tried it. but i realized that both >>>>> affect the format of the displayed value, what I need it the >>>>> "percentage" >>>>> >>>>> for examples >>>>> >>>>> the values are 7777 and 3333 >>>>> >>>>> The percentage should be 77.77 and 33.33 , however, the pie chard >>>>> displays it as 77.8 and 33.2 >>>>> I need to display more fraction digits in the "percentage" part >>>>> >>>>> >>>>> On Wed, May 21, 2014 at 2:32 PM, 'Daniel LaLiberte' via Google >>>>> Visualization API <[email protected]> wrote: >>>>> >>>>>> Mohmoud, >>>>>> >>>>>> You have conflicting format options. As the docs about the pattern >>>>>> option say: "When provided, all other options are ignored, except >>>>>> negativeColor." >>>>>> So your fractionDigits option is ignored. But you can get the >>>>>> equivalent of two decimal digits as part of your pattern by using: >>>>>> pattern: '###,###.00'. >>>>>> >>>>>> dan >>>>>> >>>>>> >>>>>> On Wed, May 21, 2014 at 8:01 AM, Mahmoud Said <[email protected]> >>>>>> wrote: >>>>>> >>>>>>> Did u reach Any solution or workaround?. i'm stuck with the same >>>>>>> problem here, I need to display 2 digits after the the decimal point in >>>>>>> the >>>>>>> percentage. apparently the use of fractionDigits does not help >>>>>>> >>>>>>> >>>>>>> >>>>>>> function drawChart(data) { >>>>>>> var data = google.visualization.arrayToDataTable([ >>>>>>> ['choice', 'sum'], >>>>>>> ['option1', data.total_val1], >>>>>>> ['option2', data.total_val2] >>>>>>> ]); >>>>>>> >>>>>>> var options = { >>>>>>> title: data.title, >>>>>>> is3D: true, >>>>>>> colors:['#CB5758','#4F8DD6'], >>>>>>> width:600, >>>>>>> height:400, >>>>>>> fontSize: 18, >>>>>>> chartArea: {width: '80%'} >>>>>>> }; >>>>>>> >>>>>>> var formatter = new >>>>>>> google.visualization.NumberFormat({pattern:'###,###', fractionDigits: >>>>>>> 2} ); >>>>>>> formatter.format(data, 1); >>>>>>> >>>>>>> var chart = new >>>>>>> google.visualization.PieChart(document.getElementById('chart_div')); >>>>>>> chart.draw(data, options); >>>>>>> } >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> On Thursday, December 13, 2012 8:41:12 PM UTC+2, Kwasi wrote: >>>>>>>> >>>>>>>> Is it possible to format the percentage in the pie chart to 2 >>>>>>>> decimal places instead of one? >>>>>>>> >>>>>>> -- >>>>>>> You received this message because you are subscribed to the Google >>>>>>> Groups "Google Visualization API" group. >>>>>>> To unsubscribe from this group and stop receiving emails from it, >>>>>>> send an email to >>>>>>> [email protected]. >>>>>>> >>>>>>> To post to this group, send email to >>>>>>> [email protected]. >>>>>>> Visit this group at >>>>>>> http://groups.google.com/group/google-visualization-api. >>>>>>> For more options, visit https://groups.google.com/d/optout. >>>>>>> >>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> Daniel LaLiberte >>>>>> <https://plus.google.com/100631381223468223275?prsrc=2> - >>>>>> 978-394-1058 >>>>>> [email protected] 5CC, Cambridge MA >>>>>> [email protected] 9 Juniper Ridge Road, Acton MA >>>>>> >>>>>> -- >>>>>> You received this message because you are subscribed to a topic in >>>>>> the Google Groups "Google Visualization API" group. >>>>>> To unsubscribe from this topic, visit >>>>>> https://groups.google.com/d/topic/google-visualization-api/vCNW1Fdva5o/unsubscribe >>>>>> . >>>>>> To unsubscribe from this group and all its topics, send an email to >>>>>> [email protected]. >>>>>> >>>>>> To post to this group, send email to [email protected] >>>>>> . >>>>>> Visit this group at >>>>>> http://groups.google.com/group/google-visualization-api. >>>>>> For more options, visit https://groups.google.com/d/optout. >>>>>> >>>>> >>>>> >>>>> >>>>> -- >>>>> Mahmoud Said >>>>> Software Engineer - eSpace >>>>> http://splinter.me/modsaid >>>>> blog.modsaid.com >>>>> >>>>> >>>>> -- >>>>> You received this message because you are subscribed to the Google >>>>> Groups "Google Visualization API" group. >>>>> To unsubscribe from this group and stop receiving emails from it, send >>>>> an email to [email protected]. >>>>> To post to this group, send email to [email protected]. >>>>> Visit this group at >>>>> http://groups.google.com/group/google-visualization-api. >>>>> For more options, visit https://groups.google.com/d/optout. >>>>> >>>> >>>> >>>> >>>> -- >>>> Daniel LaLiberte >>>> <https://plus.google.com/100631381223468223275?prsrc=2> - 978-394-1058 >>>> [email protected] 5CC, Cambridge MA >>>> [email protected] 9 Juniper Ridge Road, Acton MA >>>> >>> >> >> >> -- >> Daniel LaLiberte <https://plus.google.com/100631381223468223275?prsrc=2> >> - 978-394-1058 >> [email protected] 5CC, Cambridge MA >> [email protected] 9 Juniper Ridge Road, Acton MA >> > -- You received this message because you are subscribed to the Google Groups "Google Visualization API" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/google-visualization-api. To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/efca891a-5b32-4934-b07c-34bc19b75bb0%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
