4 <meta http-equiv=
"X-UA-Compatible" content=
"IE=EmulateIE7; IE=EmulateIE9">
5 <title>Series highlighting
</title>
7 <script type=
"text/javascript" src=
"../excanvas.js"></script>
10 For production (minified) code, use:
11 <script type=
"text/javascript" src=
"dygraph-combined.js"></script>
13 <script type=
"text/javascript" src=
"../dygraph-dev.js"></script>
15 <style type='text/css'
>
16 .few .dygraph-legend
> span.highlight { border:
1px solid grey; }
17 .many .dygraph-legend
> span { display: none; }
18 .many .dygraph-legend
> span.highlight { display: inline; }
22 <h2>Series highlighting demo
</h2>
23 <script type='text/javascript'
>
25 var getData = function(numSeries, numRows, isStacked) {
28 for (var j =
0; j < numRows; ++j) {
31 for (var i =
0; i < numSeries; ++i) {
33 for (var j =
0; j < numRows; ++j) {
37 val += Math.random() -
0.5;
45 var makeGraph = function(className, numSeries, numRows, isStacked) {
46 var div = document.createElement('div');
47 div.className = className;
48 div.style.display = 'inline-block';
49 document.body.appendChild(div);
52 for (var i =
0; i < numSeries; ++i) {
54 label = 's' + '
000'.substr(label.length) + label;
55 labels[i +
1] = label;
59 getData(numSeries, numRows, isStacked),
63 labels: labels.slice(),
64 stackedGraph: isStacked,
66 highlightCircleSize:
2,
68 strokeBorderWidth: isStacked ? null :
1,
70 highlightSeriesOpts: {
73 highlightCircleSize:
5,
76 g.setSelection(false, 's005');
80 makeGraph(
"few",
20,
50, false);
81 makeGraph(
"few",
10,
20, true);
82 makeGraph(
"many",
75,
50, false);
83 makeGraph(
"many",
40,
50, true);