Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3ce3f55

Browse files
committed
escape text to show html tags
1 parent 8654395 commit 3ce3f55

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

_posts/plotly_js/annotations/2015-10-08-style-annotation-b.html

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
y1 = d3.range(N).map( d3.random.normal(4) ),
1313
y2 = d3.range(N).map( d3.random.normal(4) ),
1414
y3 = d3.range(N).map( d3.random.normal(4) ),
15-
months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'June',
16-
'July', 'Aug', 'Sept', 'Oct', 'Nov', 'Dec'],
15+
months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'June',
16+
'July', 'Aug', 'Sept', 'Oct', 'Nov', 'Dec'],
1717
data = [{ x:x, y:y1, type:'scatter', name:'2014', text:months,
1818
mode:'markers', marker:{color:'rgba(200, 50, 100, .7)', size:16}
1919
},
@@ -25,7 +25,7 @@
2525
size:16}}];
2626
layout = {
2727
hovermode:'closest',
28-
title:'<b>Formatting Annotations</b> <br> click on a point to plot an annotation',
28+
title:'&lt;b&gt;Formatting Annotations&lt;/b&gt;&lt;br&gt; click on a point to plot an annotation',
2929
xaxis:{zeroline:false, title: 'Value A'},
3030
yaxis:{zeroline:false, title: 'Value B'}
3131
};
@@ -48,13 +48,13 @@
4848
bordercolor: point.fullData.marker.color,
4949
borderwidth: 3,
5050
borderpad: 4,
51-
text: '<i>Series Identification</i><br>'+
52-
'<b>Year</b> '+(point.data.name)+'<br>'+
53-
'<i>Point Identification</i><br>'+
54-
'<b>Month</b> '+(months[point.pointNumber])+
55-
'<br><i>Point Values</i><br>'+
56-
'<b>A</b> '+(point.x).toPrecision(4)+
57-
'<br><b>B</b> '+(point.y).toPrecision(4)
51+
text: '&lt;i&gt;Series Identification&lt;/i&gt;&lt;br&gt;'+
52+
'&lt;b&gt;Year&lt;/b&gt; '+(point.data.name)+'&lt;br&gt;'+
53+
'&lt;i&gt;Point Identification&lt;/i&gt;&lt;br&gt;'+
54+
'&lt;b&gt;Month&lt;/b&gt; '+(months[point.pointNumber])+
55+
'&lt;br&gt;&lt;i&gt;Point Values&lt;/i&gt;&lt;br&gt;'+
56+
'&lt;b&gt;A&lt;/b&gt; '+(point.x).toPrecision(4)+
57+
'&lt;br&gt;&lt;b&gt;B&lt;/b&gt; '+(point.y).toPrecision(4)
5858
},
5959
divid = document.getElementById('myDiv'),
6060
newIndex = (divid.layout.annotations || []).length;

0 commit comments

Comments
 (0)