Subversion-Projekte lars-tiefland.cienc

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
9 lars 1
<!DOCTYPE HTML>
2
<html>
3
	<head>
4
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
5
		<title>Highcharts Example</title>
6
 
7
		<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
8
		<style type="text/css">
9
${demo.css}
10
		</style>
11
		<script type="text/javascript">
12
$(function () {
13
    $('#container').highcharts({
14
        chart: {
15
            type: 'scatter',
16
            margin: [70, 50, 60, 80],
17
            events: {
18
                click: function (e) {
19
                    // find the clicked values and the series
20
                    var x = e.xAxis[0].value,
21
                        y = e.yAxis[0].value,
22
                        series = this.series[0];
23
 
24
                    // Add it
25
                    series.addPoint([x, y]);
26
 
27
                }
28
            }
29
        },
30
        title: {
31
            text: 'User supplied data'
32
        },
33
        subtitle: {
34
            text: 'Click the plot area to add a point. Click a point to remove it.'
35
        },
36
        xAxis: {
37
            gridLineWidth: 1,
38
            minPadding: 0.2,
39
            maxPadding: 0.2,
40
            maxZoom: 60
41
        },
42
        yAxis: {
43
            title: {
44
                text: 'Value'
45
            },
46
            minPadding: 0.2,
47
            maxPadding: 0.2,
48
            maxZoom: 60,
49
            plotLines: [{
50
                value: 0,
51
                width: 1,
52
                color: '#808080'
53
            }]
54
        },
55
        legend: {
56
            enabled: false
57
        },
58
        exporting: {
59
            enabled: false
60
        },
61
        plotOptions: {
62
            series: {
63
                lineWidth: 1,
64
                point: {
65
                    events: {
66
                        'click': function () {
67
                            if (this.series.data.length > 1) {
68
                                this.remove();
69
                            }
70
                        }
71
                    }
72
                }
73
            }
74
        },
75
        series: [{
76
            data: [[20, 20], [80, 80]]
77
        }]
78
    });
79
});
80
		</script>
81
	</head>
82
	<body>
83
<script src="../../js/highcharts.js"></script>
84
<script src="../../js/modules/exporting.js"></script>
85
 
86
<div id="container" style="min-width: 310px; height: 400px; max-width: 700px; margin: 0 auto"></div>
87
 
88
	</body>
89
</html>