~jstys-z/helioviewer.org/timeline

« back to all changes in this revision

Viewing changes to timeline/coverage/flags-shapes/index.htm

  • Committer: Jeff Stys
  • Date: 2014-04-21 12:46:26 UTC
  • Revision ID: jstys@sesda3.com-20140421124626-2332pb2dyjc33jxi
Proof-of-concept version of Data Coverage Timeline using Highchart/Highstock javascript library.  Changes to getDataCoverage API in order to feed the necessary data to the Timeline

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<!DOCTYPE HTML>
 
2
<html>
 
3
        <head>
 
4
                <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
 
5
                <title>Highstock Example</title>
 
6
 
 
7
                <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
 
8
                <script type="text/javascript">
 
9
$(function() {
 
10
        $.getJSON('http://www.highcharts.com/samples/data/jsonp.php?filename=usdeur.json&callback=?', function(data) {
 
11
 
 
12
                // Create the chart
 
13
                $('#container').highcharts('StockChart', {
 
14
                        
 
15
 
 
16
                        rangeSelector : {
 
17
                                selected : 1
 
18
                        },
 
19
 
 
20
                        title : {
 
21
                                text : 'USD to EUR exchange rate'
 
22
                        },
 
23
 
 
24
                        yAxis : {
 
25
                                title : {
 
26
                                        text : 'Exchange rate'
 
27
                                }
 
28
                        },
 
29
 
 
30
                        series : [{
 
31
                                name : 'USD to EUR',
 
32
                                data : data,
 
33
                                id : 'dataseries',
 
34
                                tooltip : {
 
35
                                        valueDecimals: 4
 
36
                                }
 
37
                        }, {
 
38
                                type : 'flags',
 
39
                                data : [{
 
40
                                        x : Date.UTC(2011, 1, 14),
 
41
                                        title : 'A',
 
42
                                        text : 'Shape: "squarepin"'
 
43
                                }, {
 
44
                                        x : Date.UTC(2011, 3, 28),
 
45
                                        title : 'A',
 
46
                                        text : 'Shape: "squarepin"'
 
47
                                }],
 
48
                                onSeries : 'dataseries',
 
49
                                shape : 'squarepin',
 
50
                                width : 16
 
51
                        }, {
 
52
                                type : 'flags',
 
53
                                data : [{
 
54
                                        x : Date.UTC(2011, 2, 1),
 
55
                                        title : 'B',
 
56
                                        text : 'Shape: "circlepin"'
 
57
                                }, {
 
58
                                        x : Date.UTC(2011, 3, 1),
 
59
                                        title : 'B',
 
60
                                        text : 'Shape: "circlepin"'
 
61
                                }],
 
62
                                shape : 'circlepin',
 
63
                                width : 16
 
64
                        }, {
 
65
                                type : 'flags',
 
66
                                data : [{
 
67
                                        x : Date.UTC(2011, 2, 10),
 
68
                                        title : 'C',
 
69
                                        text : 'Shape: "flag"'
 
70
                                }, {
 
71
                                        x : Date.UTC(2011, 3, 11),
 
72
                                        title : 'C',
 
73
                                        text : 'Shape: "flag"'
 
74
                                }],
 
75
                                color : '#5F86B3',
 
76
                                fillColor : '#5F86B3',
 
77
                                onSeries : 'dataseries',
 
78
                                width : 16,
 
79
                                style : {// text style
 
80
                                        color : 'white'
 
81
                                },
 
82
                                states : {
 
83
                                        hover : {
 
84
                                                fillColor : '#395C84' // darker
 
85
                                        }
 
86
                                }
 
87
                        }]
 
88
                });
 
89
        });
 
90
});
 
91
 
 
92
                </script>
 
93
        </head>
 
94
        <body>
 
95
<script src="../../js/highstock.js"></script>
 
96
<script src="../../js/modules/exporting.js"></script>
 
97
 
 
98
<div id="container" style="height: 500px"></div>
 
99
        </body>
 
100
</html>