Charts legend labels cut off

6,344 views
Skip to first unread message

Diana Despa

unread,
Sep 4, 2015, 8:05:54 AM9/4/15
to Google Visualization API
Hello! I'm using area charts and I would like to know if there is an option or any way to prevent the cut off of legend labels, it would be extremely useful for me to display the entire text. I haven't found anything related to that in the present documentation.
Thank you!

Daniel LaLiberte

unread,
Sep 4, 2015, 9:55:58 AM9/4/15
to Google Visualization API
Hi DIana,

The best you can do now to control the area for the legend, is to reserve more space on the right side of the chart, assuming that is where your legend is.  To do that, you'll want to set the width, chartArea.width and chartArea.left options.  e.g. to leave 200 pixels on the right side of a chart that is 800 wide, you could do this:

var options = {
  width: 800,
  chartArea: { width: 500, left: 100 }
}

chartArea.right == width - (chartArea.width + chartArea.left)


On Fri, Sep 4, 2015 at 8:05 AM, Diana Despa <de...@google.com> wrote:
Hello! I'm using area charts and I would like to know if there is an option or any way to prevent the cut off of legend labels, it would be extremely useful for me to display the entire text. I haven't found anything related to that in the present documentation.
Thank you!

--
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 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.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/9ea594a8-3e5c-4637-aa8f-1c3bbcb6685f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
dlaliberte@Google.com   5CC, Cambridge MA
daniel.laliberte@GMail.com 9 Juniper Ridge Road, Acton MA

Diana Despa

unread,
Sep 4, 2015, 10:06:26 AM9/4/15
to Google Visualization API
Thank you! That is a good solution, but I'm developing for mobile and I chose to  display the legend on top of the graph, due to the limited width (I should have mentioned that in the initial post). A partial solution I found is to make the font size smaller, that works well for now. :)


On Friday, September 4, 2015 at 2:55:58 PM UTC+1, Daniel LaLiberte wrote:
Hi DIana,

The best you can do now to control the area for the legend, is to reserve more space on the right side of the chart, assuming that is where your legend is.  To do that, you'll want to set the width, chartArea.width and chartArea.left options.  e.g. to leave 200 pixels on the right side of a chart that is 800 wide, you could do this:

var options = {
  width: 800,
  chartArea: { width: 500, left: 100 }
}

chartArea.right == width - (chartArea.width + chartArea.left)

On Fri, Sep 4, 2015 at 8:05 AM, Diana Despa <de...@google.com> wrote:
Hello! I'm using area charts and I would like to know if there is an option or any way to prevent the cut off of legend labels, it would be extremely useful for me to display the entire text. I haven't found anything related to that in the present documentation.
Thank you!

--
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 google-visualization-api+unsub...@googlegroups.com.



--
dlali...@Google.com   5CC, Cambridge MA
daniel.l...@GMail.com 9 Juniper Ridge Road, Acton MA
Reply all
Reply to author
Forward
0 new messages