Skip to content

Commit 27ff102

Browse files
authoredNov 11, 2024
Merge pull request #331 from plotly/remove-title-string
Update examples to use `title.text`
2 parents bff3849 + bf38db8 commit 27ff102

File tree

216 files changed

+1069
-520
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

216 files changed

+1069
-520
lines changed
 

‎_posts/plotly_js/2015-04-05-plotly_js-index.html

+24-4
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,25 @@ <h1>Plotly JavaScript Open Source Graphing Library</h1>
5151
reversescale: true, zmax: 2.5, zmin: -2.5
5252
};
5353
var layout = {
54-
title: 'turbulence simulation',
55-
xaxis: {title: 'radial direction', showline: true, mirror: 'allticks', ticks: 'inside'},
56-
yaxis: {title: 'vertical direction', showline: true, mirror: 'allticks', ticks: 'inside'},
54+
title: {
55+
text: 'turbulence simulation'
56+
},
57+
xaxis: {
58+
title: {
59+
text: 'radial direction'
60+
},
61+
showline: true,
62+
mirror: 'allticks',
63+
ticks: 'inside'
64+
},
65+
yaxis: {
66+
title: {
67+
text: 'vertical direction'
68+
},
69+
showline: true,
70+
mirror: 'allticks',
71+
ticks: 'inside'
72+
},
5773
margin: {l: 40, b: 40, t: 60},
5874
annotations: [{
5975
showarrow: false,
@@ -97,7 +113,11 @@ <h1>Plotly JavaScript Open Source Graphing Library</h1>
97113
};
98114

99115
var layout = {
100-
yaxis: {title: "Wind Speed"}, // set the y axis title
116+
yaxis: {
117+
title: {
118+
text: "Wind Speed"
119+
}
120+
}, // set the y axis title
101121
xaxis: {
102122
showgrid: false, // remove the x-axis grid lines
103123
tickformat: "%B, %Y" // customize the date format to "month, day"

‎_posts/plotly_js/2016-06-03-plotly_js_function_ref.html

+16-8
Original file line numberDiff line numberDiff line change
@@ -84,14 +84,20 @@ <h4 id="plotly-newplot"><a href="{{ BASE_URL }}/javascript/plotlyjs-function-ref
8484
}];
8585

8686
var layout = {
87-
title: 'Sales Growth',
87+
title: {
88+
text: 'Sales Growth'
89+
},
8890
xaxis: {
89-
title: 'Year',
91+
title: {
92+
text: 'Year'
93+
},
9094
showgrid: false,
9195
zeroline: false
9296
},
9397
yaxis: {
94-
title: 'Percent',
98+
title: {
99+
text: 'Percent'
100+
},
95101
showline: false
96102
}
97103
};
@@ -252,7 +258,7 @@ <h4 id="plotly-relayout"><a href="{{ BASE_URL }}/javascript/plotlyjs-function-re
252258
<pre><code class="language-javascript hljs" data-lang="javascript">
253259
// update only values within nested objects
254260
var update = {
255-
title: 'some new title', // updates the title
261+
title: {text: 'some new title'}, // updates the title
256262
'xaxis.range': [0, 5], // updates the xaxis range
257263
'yaxis.range[1]': 15 // updates the end of the yaxis range
258264
};
@@ -290,7 +296,7 @@ <h4 id="plotly-update"><a href="{{ BASE_URL }}/javascript/plotlyjs-function-refe
290296
<pre><code class="language-javascript hljs" data-lang="javascript">
291297
//update the layout and all the traces
292298
var layout_update = {
293-
title: 'some new title', // updates the title
299+
title: {text: 'some new title'}, // updates the title
294300
};
295301
var data_update = {
296302
'marker.color': 'red'
@@ -299,7 +305,7 @@ <h4 id="plotly-update"><a href="{{ BASE_URL }}/javascript/plotlyjs-function-refe
299305

300306
//update the layout and a single trace
301307
var layout_update = {
302-
title: 'some new title', // updates the title
308+
title: {text: 'some new title'}, // updates the title
303309
};
304310
var data_update = {
305311
'marker.color': 'red'
@@ -308,7 +314,7 @@ <h4 id="plotly-update"><a href="{{ BASE_URL }}/javascript/plotlyjs-function-refe
308314

309315
//update the layout and two specific traces
310316
var layout_update = {
311-
title: 'some new title', // updates the title
317+
title: {text: 'some new title'}, // updates the title
312318
};
313319
var data_update = {
314320
'marker.color': 'red'
@@ -380,7 +386,9 @@ <h4 id="plotly-makeTemplate"><a href="{{ BASE_URL }}/javascript/plotlyjs-functio
380386
y: [2, 1, 3, 2],
381387
}],
382388
layout:{
383-
title: 'Quarterly Earnings'
389+
title: {
390+
text: 'Quarterly Earnings'
391+
}
384392
}
385393
};
386394

0 commit comments

Comments
 (0)
Please sign in to comment.