Hi all,

I'm trying to format the value in the bar chart, so far it works only for 
the tooltips but not the ones displayed in the bar:

<https://lh3.googleusercontent.com/-D4BAd-TJwr8/WyPpcKVkXhI/AAAAAAAAEUo/lCM9iJKdATcCT8X30ngT8m47-YEkEqiRgCLcBGAs/s1600/screenshot.png>
Below is my snippet:

var data = google.visualization.arrayToDataTable([
        ['Item', 'Percentage', {role: 'style'}],
        ['Item 1', 0.6721, 'color:#00CCFF'],
        ['Item 2', 0.2295, 'color:#00CCFF'],
        ['Item 3', 0.0984, 'color:#00CCFF']
      ]);

      var formatter = new google.visualization.NumberFormat({pattern: 
'0.00%'});
      
      var view = new google.visualization.DataView(data);
      view.setColumns([0, 1,
                       { calc: formatter.format(data, 1),
                         sourceColumn: 1,
                         type: "number",
                         role: "annotation" },
                       2]);

Any help would be greatly appreciated.

Regards,
Jeff

-- 
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/ea794373-f975-4e1b-a577-c4e92eb678dc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to