1
votes

For a statistics/monitoring tool we use google charts graphs to show messages and errors from an application. Those messages are shown in labels of a graphics on the vertical axis but most of the times the messagetexts are too long, having too much characters to be fit in the label. They get shortcutted by ... in the end but what we actually want is that they are wordwrapped or if that is not possible, manually linebreaked with html br tags. Too bad, those are just ignored by the google chart labels.

My question is, is there a way to break the messagetexts over multiple lines instead of getting shortcutted with ... at the end? If so, how can this be done? I already found the possibility for this for the horizontal axis here, but we want it to have it for the vertical axis. If it is possible of course.

I also tried to make a fiddler example but it seems fiddler can't handle google graphs that well. When I made the text as long as in our tool, the whole graphics just disappeared.

1

1 Answers

0
votes

The text labels for tick values of axes, both horizontal and vertical, cannot currently be wrapped across multiple lines. The best you can do is arrange that there is more space for the labels by using a combination of the width and chartArea: { width and left } options, for the vertical axis, or height and chartArea: { height and top } options.

Here is a jsfiddle that demonstrates this: http://jsfiddle.net/dlaliberte/cNRn3/ with a bar chart. The key option is this:

chartArea: { left: 300 }