Line chart vertical side percentage

50 views
Skip to first unread message

TheInnovator

unread,
May 26, 2014, 6:31:36 PM5/26/14
to google-visua...@googlegroups.com
How can I make the vertical side of the line chart a percentage (0-100%)?

Isaac Sogunro

unread,
May 26, 2014, 6:33:49 PM5/26/14
to google-visua...@googlegroups.com
I also tried but to no avail.

 //Use to convert the value in the 4th column to a percentage
 var formatter = new google.visualization.NumberFormat({ 
  pattern: '#%'
});
formatter.format(data, 1); // format column 4 in DataTable "data"
formatter.format(data, 2);


On Mon, May 26, 2014 at 6:31 PM, TheInnovator <isog...@gmail.com> wrote:
How can I make the vertical side of the line chart a percentage (0-100%)?

--
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/FAFAmqBTrQo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-visualizati...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/d/optout.



--
-Isaac-

http://twitter.com/#!/feedy0urmind
You are today where your thoughts have brought you; you will be tomorrow where your thoughts take you.
- James Allen

Andrew Gallant

unread,
May 26, 2014, 9:52:41 PM5/26/14
to google-visua...@googlegroups.com
The NumberFormatter will format your data.  To format the axis, you need to use the vAxis.format option:

vAxis: {
    format: '#%'
}


On Monday, May 26, 2014 6:33:49 PM UTC-4, TheInnovator wrote:
I also tried but to no avail.

 //Use to convert the value in the 4th column to a percentage
 var formatter = new google.visualization.NumberFormat({ 
  pattern: '#%'
});
formatter.format(data, 1); // format column 4 in DataTable "data"
formatter.format(data, 2);
On Mon, May 26, 2014 at 6:31 PM, TheInnovator <isog...@gmail.com> wrote:
How can I make the vertical side of the line chart a percentage (0-100%)?

--
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/FAFAmqBTrQo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-visualization-api+unsub...@googlegroups.com.

To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/d/optout.

Isaac Sogunro

unread,
May 26, 2014, 10:57:27 PM5/26/14
to google-visua...@googlegroups.com
Thanks!


To unsubscribe from this group and all its topics, send an email to google-visualizati...@googlegroups.com.

To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/d/optout.

Isaac Sogunro

unread,
May 29, 2014, 11:05:05 AM5/29/14
to google-visua...@googlegroups.com
I am trying to add my legend to the bottom but whenever I do the months that line up along the x-axis disappears.
Ex:

Before:


After:

Here's the code I used to code the after:
I added position:'bottom
        var options = {
          title: 'Overall 508 Compliance Monthly Score Trend Analysis',
 colors: ["#6A0888", "#045FB4"],
 hAxis: {title: 'Month'},
 titleTextStyle: {color: 'black', fontName: '"Arial"', fontSize: '15'},
 legend: {textStyle: {color: 'black', fontName: '"Arial"', fontSize: '12'}, position:'bottom'},
 vAxis: {
title: 'Score',
format: '#%'
}
};

Andrew Gallant

unread,
May 29, 2014, 8:40:29 PM5/29/14
to google-visua...@googlegroups.com
Try setting the chartArea.height option, or increasing the height of the chart.  The chartArea.height option can take an integer (pixels high) or a string (percent of total chart height).  If you shrink the height of the chartArea or increase the total chart height (or some combination of the two), that should give your axis titles more room to draw.
Thanks!


To unsubscribe from this group and all its topics, send an email to google-visualization-api+unsubscr...@googlegroups.com.

Isaac Sogunro

unread,
May 30, 2014, 9:58:45 AM5/30/14
to google-visua...@googlegroups.com
Thanks Andrew!


To unsubscribe from this group and all its topics, send an email to google-visualizati...@googlegroups.com.

To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/d/optout.

Isaac Sogunro

unread,
Jun 3, 2014, 2:58:07 PM6/3/14
to google-visua...@googlegroups.com
Hello,

I am trying to add a coma to the data in columns 1, 2 and 3 but it's not working.  Enter the following date 10/2013

 //Use to convert the value in the 4th column to a percentage
 var formatter2 = new google.visualization.NumberFormat({pattern: '#,###'});
formatter2.format(data, 1);

 //Use to convert the value in the 4th column to a percentage
 var formatter3 = new google.visualization.NumberFormat({pattern: '#,###'});
formatter3.format(data, 2);

 //Use to convert the value in the 4th column to a percentage
 var formatter4 = new google.visualization.NumberFormat({pattern: '#,###'});
formatter4.format(data, 3);


To unsubscribe from this group and all its topics, send an email to google-visualizati...@googlegroups.com.

To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/d/optout.

Isaac Sogunro

unread,
Jun 3, 2014, 3:16:10 PM6/3/14
to google-visua...@googlegroups.com
Modified but not working

  //Use to convert the value in the 4th column to a percentage
 var formatter2 = new google.visualization.NumberFormat({pattern: '#,###'});
formatter2.format(lastAtutoMonthDataTbl, 1);

 //Use to convert the value in the 4th column to a percentage
 var formatter3 = new google.visualization.NumberFormat({pattern: '#,###'});
formatter3.format(lastAtutoMonthDataTbl, 2);

 //Use to convert the value in the 4th column to a percentage
 var formatter4 = new google.visualization.NumberFormat({pattern: '#,###'});
formatter4.format(lastAtutoMonthDataTbl, 3);
 //Use to convert the value in the 4th column to a percentage

Isaac Sogunro

unread,
Jun 3, 2014, 3:31:58 PM6/3/14
to google-visua...@googlegroups.com
Never mind.  I figured it out.  THanks!
Reply all
Reply to author
Forward
0 new messages