Subversion-Projekte lars-tiefland.cienc

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
9 lars 1
<!DOCTYPE html>
2
 
3
<html>
4
<head>
5
 
6
    <title>Draw Lines on Plots - Canvas Overlay</title>
7
 
8
    <link class="include" rel="stylesheet" type="text/css" href="../jquery.jqplot.min.css" />
9
    <link rel="stylesheet" type="text/css" href="examples.min.css" />
10
    <link type="text/css" rel="stylesheet" href="syntaxhighlighter/styles/shCoreDefault.min.css" />
11
    <link type="text/css" rel="stylesheet" href="syntaxhighlighter/styles/shThemejqPlot.min.css" />
12
 
13
    <!--[if lt IE 9]><script language="javascript" type="text/javascript" src="../excanvas.js"></script><![endif]-->
14
    <script class="include" type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
15
 
16
 
17
</head>
18
<body>
19
    <div id="header">
20
        <div class="nav">
21
            <a class="nav" href="../../../index.php"><span>&gt;</span>Home</a>
22
            <a class="nav"  href="../../../docs/"><span>&gt;</span>Docs</a>
23
            <a class="nav"  href="../../download/"><span>&gt;</span>Download</a>
24
            <a class="nav" href="../../../info.php"><span>&gt;</span>Info</a>
25
            <a class="nav"  href="../../../donate.php"><span>&gt;</span>Donate</a>
26
        </div>
27
    </div>
28
    <div class="colmask leftmenu">
29
      <div class="colleft">
30
        <div class="col1" id="example-content">
31
 
32
 
33
<!-- Example scripts go here -->
34
 
35
 
36
    <div id="chart1" style="margin-top:20px; margin-left:20px; width:400px; height:300px;"></div>
37
    <button onclick="lineup()">Up</button>
38
    <button onclick="linedown()">Down</button>
39
 
40
<pre class="code prettyprint brush: js"></pre>
41
 
42
    <div id="chart2" style="margin-top:20px; margin-left:20px; width:400px; height:300px;"></div>
43
<pre class="code prettyprint brush: js"></pre>
44
 
45
 
46
  <script class="code" type="text/javascript">
47
$(document).ready(function(){
48
    var s1 = [[2009, 3.5], [2010, 4.4], [2011, 6.0], [2012, 9.1], [2013, 12.0], [2014, 14.4]];
49
 
50
    var grid = {
51
        gridLineWidth: 1.5,
52
        gridLineColor: 'rgb(235,235,235)',
53
        drawGridlines: true
54
    };
55
 
56
    plot1 = $.jqplot('chart1', [s1], {
57
        series:[{
58
            renderer:$.jqplot.BarRenderer,
59
            rendererOptions: {
60
                barWidth: 30
61
            }
62
        }],
63
        axes: {
64
            xaxis: {
65
                renderer: $.jqplot.CategoryAxisRenderer
66
            }
67
        },
68
        grid: grid,
69
        canvasOverlay: {
70
            show: true,
71
            objects: [
72
                {horizontalLine: {
73
                    name: 'barney',
74
                    y: 4,
75
                    lineWidth: 6,
76
                    color: 'rgb(100, 55, 124)',
77
                    shadow: false
78
                }},
79
                {horizontalLine: {
80
                    name: 'fred',
81
                    y: 6,
82
                    lineWidth: 12,
83
                    xminOffset: '8px',
84
                    xmaxOffset: '29px',
85
                    color: 'rgb(50, 55, 30)',
86
                    shadow: false
87
                }},
88
                {dashedHorizontalLine: {
89
                    name: 'wilma',
90
                    y: 8,
91
                    lineWidth: 2,
92
                    xOffset: '54',
93
                    color: 'rgb(133, 120, 24)',
94
                    shadow: false
95
                }},
96
                {horizontalLine: {
97
                    name: 'pebbles',
98
                    y: 10,
99
                    lineWidth: 3,
100
                    xOffset: 0,
101
                    color: 'rgb(89, 198, 154)',
102
                    shadow: false
103
                }},
104
                {dashedHorizontalLine: {
105
                    name: 'bam-bam',
106
                    y: 14,
107
                    lineWidth: 5,
108
                    dashPattern: [16, 12],
109
                    lineCap: 'round',
110
                    xOffset: '20',
111
                    color: 'rgb(66, 98, 144)',
112
                    shadow: false
113
                }}
114
            ]
115
        }
116
    });
117
});
118
 
119
function lineup() {
120
    var co = plot1.plugins.canvasOverlay;
121
    var line = co.get('fred');
122
    line.options.y += 1;
123
    co.draw(plot1);
124
}
125
 
126
function linedown() {
127
    var co = plot1.plugins.canvasOverlay;
128
    var line = co.get('fred');
129
    line.options.y -= 1;
130
    co.draw(plot1);
131
}
132
 
133
    </script>
134
 
135
<script class="code" type="text/javascript">
136
$(document).ready(function(){
137
    var s2 = [[9, 3.5], [15, 4.4], [22, 6.0], [38, 9.1], [51, 12.0], [62, 14.4]];
138
 
139
    var grid = {
140
        gridLineWidth: 1.5,
141
        gridLineColor: 'rgb(235,235,235)',
142
        drawGridlines: true
143
    };
144
 
145
    plot2 = $.jqplot('chart2', [s2], {
146
        grid: grid,
147
        canvasOverlay: {
148
            show: true,
149
            objects: [
150
                {verticalLine: {
151
                    name: 'barney',
152
                    x: 10,
153
                    lineWidth: 6,
154
                    color: 'rgb(100, 55, 124)',
155
                    shadow: false
156
                }},
157
                {verticalLine: {
158
                    name: 'fred',
159
                    x: 15,
160
                    lineWidth: 12,
161
                    yminOffset: '8px',
162
                    ymaxOffset: '29px',
163
                    color: 'rgb(50, 55, 30)',
164
                    shadow: false
165
                }},
166
                {dashedVerticalLine: {
167
                    name: 'wilma',
168
                    x: 20,
169
                    lineWidth: 2,
170
                    yOffset: '14',
171
                    color: 'rgb(133, 120, 24)',
172
                    shadow: false
173
                }},
174
                {verticalLine: {
175
                    name: 'pebbles',
176
                    x: 35,
177
                    lineWidth: 3,
178
                    yOffset: 0,
179
                    lineCap: 'butt',
180
                    color: 'rgb(89, 198, 154)',
181
                    shadow: false
182
                }},
183
                {dashedVerticalLine: {
184
                    name: 'bam-bam',
185
                    x: 45,
186
                    lineWidth: 5,
187
                    dashPattern: [16, 12],
188
                    lineCap: 'round',
189
                    yOffset: '20px',
190
                    color: 'rgb(66, 98, 144)',
191
                    shadow: false
192
                }}
193
            ]
194
        }
195
    });
196
 
197
});
198
 
199
 
200
</script>
201
 
202
<!-- End example scripts -->
203
 
204
<!-- Don't touch this! -->
205
 
206
 
207
    <script class="include" type="text/javascript" src="../jquery.jqplot.min.js"></script>
208
    <script type="text/javascript" src="syntaxhighlighter/scripts/shCore.min.js"></script>
209
    <script type="text/javascript" src="syntaxhighlighter/scripts/shBrushJScript.min.js"></script>
210
    <script type="text/javascript" src="syntaxhighlighter/scripts/shBrushXml.min.js"></script>
211
<!-- End Don't touch this! -->
212
 
213
<!-- Additional plugins go here -->
214
 
215
  <script language="javascript" type="text/javascript" src="../plugins/jqplot.barRenderer.min.js"></script>
216
  <script language="javascript" type="text/javascript" src="../plugins/jqplot.categoryAxisRenderer.min.js"></script>
217
  <script language="javascript" type="text/javascript" src="../plugins/jqplot.canvasTextRenderer.min.js"></script>
218
  <script language="javascript" type="text/javascript" src="../plugins/jqplot.canvasAxisTickRenderer.min.js"></script>
219
  <script language="javascript" type="text/javascript" src="../plugins/jqplot.canvasOverlay.min.js"></script>
220
 
221
<!-- End additional plugins -->
222
 
223
        </div>
224
         <div class="col2">
225
 
226
           <div class="example-link"><a class="example-link" href="data-renderers.html">AJAX and JSON Data Loading via Data Renderers</a></div>
227
           <div class="example-link"><a class="example-link" href="barLineAnimated.html">Animated Charts</a></div>
228
           <div class="example-link"><a class="example-link" href="dashboardWidget.html">Animated Dashboard Sample - Filled Line with Log Axis</a></div>
229
           <div class="example-link"><a class="example-link" href="kcp_area.html">Area Chart</a></div>
230
           <div class="example-link"><a class="example-link" href="kcp_area2.html">Area Chart 2</a></div>
231
           <div class="example-link"><a class="example-link" href="axisLabelTests.html">Axis Labels</a></div>
232
           <div class="example-link"><a class="example-link" href="axisLabelsRotatedText.html">Axis Labels and Rotated Text</a></div>
233
           <div class="example-link"><a class="example-link" href="barTest.html">Bar Charts</a></div>
234
           <div class="example-link"><a class="example-link" href="multipleBarColors.html">Bar Colors Example</a></div>
235
           <div class="example-link"><a class="example-link" href="bezierCurve.html">Bezier Curve Plots</a></div>
236
           <div class="example-link"><a class="example-link" href="blockPlot.html">Block Plots</a></div>
237
           <div class="example-link"><a class="example-link" href="bubbleChart.html">Bubble Charts</a></div>
238
           <div class="example-link"><a class="example-link" href="bubble-plots.html">Bubble Plots</a></div>
239
           <div class="example-link"><a class="example-link" href="candlestick.html">Candlestick and Open Hi Low Close Charts</a></div>
240
           <div class="example-link"><a class="example-link" href="theming.html">Chart Theming</a></div>
241
           <div class="example-link"><a class="example-link" href="fillBetweenLines.html">Charts with Fill Between Lines</a></div>
242
           <div class="example-link"><a class="example-link" href="kcp_cdf.html">Cumulative Density Function Chart</a></div>
243
           <div class="example-link"><a class="example-link" href="dashedLines.html">Dashed Lines with Smoothing</a></div>
244
           <div class="example-link"><a class="example-link" href="cursor-highlighter.html">Data Point Highlighting, Tooltips and Cursor Tracking</a></div>
245
           <div class="example-link"><a class="example-link" href="point-labels.html">Data Point labels</a></div>
246
           <div class="example-link"><a class="example-link" href="date-axes.html">Date Axes</a></div>
247
           <div class="example-link"><a class="example-link" href="dateAxisRenderer.html">Date Axes 2</a></div>
248
           <div class="example-link"><a class="example-link" href="rotatedTickLabelsZoom.html">Date Axes, Rotated Labels and Zooming</a></div>
249
           <div class="example-link"><a class="example-link" href="canvas-overlay.html">Draw Lines on Plots - Canvas Overlay</a></div>
250
           <div class="example-link"><a class="example-link" href="draw-rectangles.html">Draw Rectangles on Plots</a></div>
251
           <div class="example-link"><a class="example-link" href="kcp_engel.html">Engel Curves</a></div>
252
           <div class="example-link"><a class="example-link" href="bandedLine.html">Error Bands and Confidence Intervals</a></div>
253
           <div class="example-link"><a class="example-link" href="area.html">Filled (Area) Charts</a></div>
254
           <div class="example-link"><a class="example-link" href="axisScalingForceTickAt.html">Force Plot to Have Tick at 0 or 100</a></div>
255
           <div class="example-link"><a class="example-link" href="hiddenPlotsInTabs.html">Hidden Plots</a></div>
256
           <div class="example-link"><a class="example-link" href="customHighlighterCursorTrendline.html">Highlighting, Dragging Points, Cursor and Trend Lines</a></div>
257
           <div class="example-link"><a class="example-link" href="line-charts.html">Line Charts and Options</a></div>
258
           <div class="example-link"><a class="example-link" href="kcp_lorenz.html">Lorenz Curves</a></div>
259
           <div class="example-link"><a class="example-link" href="mekkoCharts.html">Mekko Charts</a></div>
260
           <div class="example-link"><a class="example-link" href="meterGauge.html">Meter Gauge</a></div>
261
           <div class="example-link"><a class="example-link" href="candlestick-charts.html">Open Hi Low Close and Candlestick Charts</a></div>
262
           <div class="example-link"><a class="example-link" href="pieTest.html">Pie Charts and Options</a></div>
263
           <div class="example-link"><a class="example-link" href="pieTest4.html">Pie Charts and Options 2</a></div>
264
           <div class="example-link"><a class="example-link" href="pie-donut-charts.html">Pie and Donut Charts</a></div>
265
           <div class="example-link"><a class="example-link" href="selectorSyntax.html">Plot Creation with jQuery Selectors</a></div>
266
           <div class="example-link"><a class="example-link" href="zooming.html">Plot Zooming and Cursor Control</a></div>
267
           <div class="example-link"><a class="example-link" href="kcp_pdf.html">Probability Density Function Chart</a></div>
268
           <div class="example-link"><a class="example-link" href="kcp_pyramid_by_age.html">Pyramid Chart By Age</a></div>
269
           <div class="example-link"><a class="example-link" href="kcp_pyramid.html">Pyramid Charts</a></div>
270
           <div class="example-link"><a class="example-link" href="kcp_pyramid2.html">Pyramid Charts 2</a></div>
271
           <div class="example-link"><a class="example-link" href="kcp_quintiles.html">Quintile Pyramid Charts</a></div>
272
           <div class="example-link"><a class="example-link" href="resizablePlot.html">Resizable Plots</a></div>
273
           <div class="example-link"><a class="example-link" href="rotated-tick-labels.html">Rotated Labels and Font Styling</a></div>
274
           <div class="example-link"><a class="example-link" href="smoothedLine.html">Smoothed Lines</a></div>
275
           <div class="example-link"><a class="example-link" href="bar-charts.html">Vertical and Horizontal Bar Charts</a></div>
276
           <div class="example-link"><a class="example-link" href="waterfall.html">Waterfall Charts</a></div>
277
           <div class="example-link"><a class="example-link" href="waterfall2.html">Waterfall Charts 2</a></div>
278
           <div class="example-link"><a class="example-link" href="zoomOptions.html">Zoom Options</a></div>
279
           <div class="example-link"><a class="example-link" href="zoomProxy.html">Zoom Proxy - Control one plot from another</a></div>
280
           <div class="example-link"><a class="example-link" href="zoom1.html">Zooming</a></div>
281
           <div class="example-link"><a class="example-link" href="dateAxisLogAxisZooming.html">Zooming with Date and Log Axes</a></div>
282
 
283
         </div>
284
               </div>
285
    </div>
286
    <script type="text/javascript" src="example.min.js"></script>
287
 
288
</body>
289
 
290
 
291
</html>