|
12 | 12 | y1 = d3.range(N).map( d3.random.normal(4) ),
|
13 | 13 | y2 = d3.range(N).map( d3.random.normal(4) ),
|
14 | 14 | 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'], |
17 | 17 | data = [{ x:x, y:y1, type:'scatter', name:'2014', text:months,
|
18 | 18 | mode:'markers', marker:{color:'rgba(200, 50, 100, .7)', size:16}
|
19 | 19 | },
|
|
25 | 25 | size:16}}];
|
26 | 26 | layout = {
|
27 | 27 | hovermode:'closest',
|
28 |
| - title:'<b>Formatting Annotations</b> <br> click on a point to plot an annotation', |
| 28 | + title:'<b>Formatting Annotations</b><br> click on a point to plot an annotation', |
29 | 29 | xaxis:{zeroline:false, title: 'Value A'},
|
30 | 30 | yaxis:{zeroline:false, title: 'Value B'}
|
31 | 31 | };
|
|
48 | 48 | bordercolor: point.fullData.marker.color,
|
49 | 49 | borderwidth: 3,
|
50 | 50 | 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: '<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) |
58 | 58 | },
|
59 | 59 | divid = document.getElementById('myDiv'),
|
60 | 60 | newIndex = (divid.layout.annotations || []).length;
|
|
0 commit comments