Sunday, May 19, 2024
 Popular · Latest · Hot · Upcoming
40
rated 0 times [  45] [ 5]  / answers: 1 / hits: 18125  / 8 Years ago, wed, february 3, 2016, 12:00:00

I am using the Plot.ly JS for graphs. The graphs are charting the answers given to certain questions in a survey. So, the title of the graph is the question itself which can get a little long. Right now, the title runs off the graph and is hidden as seen in the image below (can't embed images yet on Stack Overflow so it created a link to the image instead):



Plotly



This is the code being called where values and labels are variables defined elsewhere:



var graph_data = [
{
values: values,
labels: labels,
type: 'pie'
}
];
var layout = {
title: 'How responsive has our support team been to your questions or concerns?'
};
Plotly.newPlot( chartID, graph_data, layout );


I tried adding new line characters into the string such as r and n and rn and it did not work. I also tried changing the CSS property of word-wrap and it did not work. Any advice to easily show the title on multiple lines in Plot.ly JS?


More From » charts

 Answers
12

Use <br> to break lines in plotly strings.


[#63456] Monday, February 1, 2016, 8 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
kinsley

Total Points: 352
Total Questions: 84
Total Answers: 94

Location: Denmark
Member since Tue, Jul 19, 2022
2 Years ago
;