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>Filled (Area) Charts</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
<style type="text/css">
36
.jqplot-target {
37
    margin: 30px;
38
}
39
 
40
#customTooltipDiv {
41
    position: absolute;
42
    display: none;
43
    color: #333333;
44
    font-size: 0.8em;
45
    border: 1px solid #666666;
46
    background-color: rgba(160, 160, 160, 0.2);
47
    padding: 2px;
48
}
49
</style>
50
 
51
<p>Area charts support highlighting and mouse events by default.  The options and handlers and callbacks are essentially the same as with bar, pie, donut and funnel charts.  One notable exception for area charts is that no data point index will be provided to the callback and the entire data set for the highlighted area will be returned.  This is because the area is not associated with one particular data point, but with the entire data set of the series.</p>
52
 
53
<div><span>Moused Over: </span><span id="info1b">Nothing</span></div>
54
 
55
<div id="chart1b" style="width:400px;height:260px;"></div>
56
 
57
<p>For the chart below, mouseover has been disabled and click handling is enabled by setting "highlightMouseDown: true".  For "fillToZero" area charts that have both negative and positive values as shown below, clicking in either the positive of negative regions will generate the same result.</p>
58
 
59
<div><span>You Clicked: </span><span id="info1c">Nothing yet</span></div>
60
 
61
<div id="chart1c" style="width:400px;height:260px;"></div>
62
 
63
<div id="chart2" style="width:600px;height:260px;"></div>
64
 
65
<div id="customTooltipDiv">I'm a tooltip.</div>
66
 
67
 
68
 
69
<script class="code" language="javascript" type="text/javascript">
70
$(document).ready(function(){
71
 
72
    var l2 = [11, 9, 5, 12, 14];
73
    var l3 = [4, 8, 5, 3, 6];
74
    var l4 = [12, 6, 13, 11, 2];
75
 
76
 
77
    var plot1b = $.jqplot('chart1b',[l2, l3, l4],{
78
       stackSeries: true,
79
       showMarker: false,
80
       seriesDefaults: {
81
           fill: true
82
       },
83
       axes: {
84
           xaxis: {
85
               renderer: $.jqplot.CategoryAxisRenderer,
86
               ticks: ["Mon", "Tue", "Wed", "Thr", "Fri"]
87
           }
88
       }
89
    });
90
 
91
    $('#chart1b').bind('jqplotDataHighlight',
92
        function (ev, seriesIndex, pointIndex, data) {
93
            $('#info1b').html('series: '+seriesIndex+', point: '+pointIndex+', data: '+data);
94
        }
95
    );
96
 
97
    $('#chart1b').bind('jqplotDataUnhighlight',
98
        function (ev) {
99
            $('#info1b').html('Nothing');
100
        }
101
    );
102
});
103
</script>
104
 
105
 
106
<script class="code" language="javascript" type="text/javascript">
107
$(document).ready(function(){
108
    var l5 = [4, -3, 3, 6, 2, -2];
109
    var plot1c = $.jqplot('chart1c',[l5],{
110
       stackSeries: true,
111
       showMarker: false,
112
       seriesDefaults: {
113
           fill: true,
114
           fillToZero: true,
115
           rendererOptions: {
116
               highlightMouseDown: true
117
           }
118
       }
119
    });
120
 
121
    $('#chart1c').bind('jqplotDataClick',
122
        function (ev, seriesIndex, pointIndex, data) {
123
            $('#info1c').html('series: '+seriesIndex+', point: '+pointIndex+', data: '+data);
124
        }
125
    );
126
});
127
</script>
128
 
129
 
130
<script class="code" language="javascript" type="text/javascript">
131
$(document).ready(function(){
132
    var l6 = [11, 9, 5, 12, 14, 8, 7, 9, 6, 11, 9, 3, 4];
133
    var l7 = [4, 8, 5, 3, 6, 5, 3, 2, 6, 7, 4, 3, 2];
134
    var l8 = [12, 6, 13, 11, 2, 3, 4, 2, 1, 5, 7, 4, 8];
135
 
136
    var ticks = [[1,'Dec 10'], [2,'Jan 11'], [3,'Feb 11'], [4,'Mar 11'], [5,'Apr 11'], [6,'May 11'], [7,'Jun 11'], [8,'Jul 11'], [9,'Aug 11'], [10,'Sep 11'], [11,'Oct 11'], [12,'Nov 11'], [13,'Dec 11']];
137
 
138
 
139
    plot2 = $.jqplot('chart2',[l6, l7, l8],{
140
       stackSeries: true,
141
       showMarker: false,
142
       highlighter: {
143
        show: true,
144
        showTooltip: false
145
       },
146
       seriesDefaults: {
147
           fill: true,
148
       },
149
       series: [
150
        {label: 'Beans'},
151
        {label: 'Oranges'},
152
        {label: 'Crackers'}
153
       ],
154
       legend: {
155
        show: true,
156
        placement: 'outsideGrid'
157
       },
158
       grid: {
159
        drawBorder: false,
160
        shadow: false
161
       },
162
       axes: {
163
           xaxis: {
164
              ticks: ticks,
165
              tickRenderer: $.jqplot.CanvasAxisTickRenderer,
166
              tickOptions: {
167
                angle: -90
168
              },
169
              drawMajorGridlines: false
170
          }
171
        }
172
    });
173
 
174
    // capture the highlighters highlight event and show a custom tooltip.
175
    $('#chart2').bind('jqplotHighlighterHighlight',
176
        function (ev, seriesIndex, pointIndex, data, plot) {
177
            // create some content for the tooltip.  Here we want the label of the tick,
178
            // which is not supplied to the highlighters standard tooltip.
179
            var content = plot.series[seriesIndex].label + ', ' + plot.series[seriesIndex]._xaxis.ticks[pointIndex][1] + ', ' + data[1];
180
            // get a handle on our custom tooltip element, which was previously created
181
            // and styled.  Be sure it is initiallly hidden!
182
            var elem = $('#customTooltipDiv');
183
            elem.html(content);
184
            // Figure out where to position the tooltip.
185
            var h = elem.outerHeight();
186
            var w = elem.outerWidth();
187
            var left = ev.pageX - w - 10;
188
            var top = ev.pageY - h - 10;
189
            // now stop any currently running animation, position the tooltip, and fade in.
190
            elem.stop(true, true).css({left:left, top:top}).fadeIn(200);
191
        }
192
    );
193
 
194
    // Hide the tooltip when unhighliting.
195
    $('#chart2').bind('jqplotHighlighterUnhighlight',
196
        function (ev) {
197
            $('#customTooltipDiv').fadeOut(300);
198
        }
199
    );
200
});
201
</script>
202
 
203
<!-- End example scripts -->
204
 
205
<!-- Don't touch this! -->
206
 
207
 
208
    <script class="include" type="text/javascript" src="../jquery.jqplot.min.js"></script>
209
    <script type="text/javascript" src="syntaxhighlighter/scripts/shCore.min.js"></script>
210
    <script type="text/javascript" src="syntaxhighlighter/scripts/shBrushJScript.min.js"></script>
211
    <script type="text/javascript" src="syntaxhighlighter/scripts/shBrushXml.min.js"></script>
212
<!-- Additional plugins go here -->
213
 
214
  <script class="include" type="text/javascript" src="../plugins/jqplot.categoryAxisRenderer.min.js"></script>
215
  <script class="include" type="text/javascript" src="../plugins/jqplot.highlighter.min.js"></script>
216
  <script class="include" type="text/javascript" src="../plugins/jqplot.canvasTextRenderer.min.js"></script>
217
  <script class="include" type="text/javascript" src="../plugins/jqplot.canvasAxisTickRenderer.min.js"></script>
218
 
219
<!-- End additional plugins -->
220
 
221
        </div>
222
         <div class="col2">
223
 
224
           <div class="example-link"><a class="example-link" href="data-renderers.html">AJAX and JSON Data Loading via Data Renderers</a></div>
225
           <div class="example-link"><a class="example-link" href="barLineAnimated.html">Animated Charts</a></div>
226
           <div class="example-link"><a class="example-link" href="dashboardWidget.html">Animated Dashboard Sample - Filled Line with Log Axis</a></div>
227
           <div class="example-link"><a class="example-link" href="kcp_area.html">Area Chart</a></div>
228
           <div class="example-link"><a class="example-link" href="kcp_area2.html">Area Chart 2</a></div>
229
           <div class="example-link"><a class="example-link" href="axisLabelTests.html">Axis Labels</a></div>
230
           <div class="example-link"><a class="example-link" href="axisLabelsRotatedText.html">Axis Labels and Rotated Text</a></div>
231
           <div class="example-link"><a class="example-link" href="barTest.html">Bar Charts</a></div>
232
           <div class="example-link"><a class="example-link" href="multipleBarColors.html">Bar Colors Example</a></div>
233
           <div class="example-link"><a class="example-link" href="bezierCurve.html">Bezier Curve Plots</a></div>
234
           <div class="example-link"><a class="example-link" href="blockPlot.html">Block Plots</a></div>
235
           <div class="example-link"><a class="example-link" href="bubbleChart.html">Bubble Charts</a></div>
236
           <div class="example-link"><a class="example-link" href="bubble-plots.html">Bubble Plots</a></div>
237
           <div class="example-link"><a class="example-link" href="candlestick.html">Candlestick and Open Hi Low Close Charts</a></div>
238
           <div class="example-link"><a class="example-link" href="theming.html">Chart Theming</a></div>
239
           <div class="example-link"><a class="example-link" href="fillBetweenLines.html">Charts with Fill Between Lines</a></div>
240
           <div class="example-link"><a class="example-link" href="kcp_cdf.html">Cumulative Density Function Chart</a></div>
241
           <div class="example-link"><a class="example-link" href="dashedLines.html">Dashed Lines with Smoothing</a></div>
242
           <div class="example-link"><a class="example-link" href="cursor-highlighter.html">Data Point Highlighting, Tooltips and Cursor Tracking</a></div>
243
           <div class="example-link"><a class="example-link" href="point-labels.html">Data Point labels</a></div>
244
           <div class="example-link"><a class="example-link" href="date-axes.html">Date Axes</a></div>
245
           <div class="example-link"><a class="example-link" href="dateAxisRenderer.html">Date Axes 2</a></div>
246
           <div class="example-link"><a class="example-link" href="rotatedTickLabelsZoom.html">Date Axes, Rotated Labels and Zooming</a></div>
247
           <div class="example-link"><a class="example-link" href="canvas-overlay.html">Draw Lines on Plots - Canvas Overlay</a></div>
248
           <div class="example-link"><a class="example-link" href="draw-rectangles.html">Draw Rectangles on Plots</a></div>
249
           <div class="example-link"><a class="example-link" href="kcp_engel.html">Engel Curves</a></div>
250
           <div class="example-link"><a class="example-link" href="bandedLine.html">Error Bands and Confidence Intervals</a></div>
251
           <div class="example-link"><a class="example-link" href="area.html">Filled (Area) Charts</a></div>
252
           <div class="example-link"><a class="example-link" href="axisScalingForceTickAt.html">Force Plot to Have Tick at 0 or 100</a></div>
253
           <div class="example-link"><a class="example-link" href="hiddenPlotsInTabs.html">Hidden Plots</a></div>
254
           <div class="example-link"><a class="example-link" href="customHighlighterCursorTrendline.html">Highlighting, Dragging Points, Cursor and Trend Lines</a></div>
255
           <div class="example-link"><a class="example-link" href="line-charts.html">Line Charts and Options</a></div>
256
           <div class="example-link"><a class="example-link" href="kcp_lorenz.html">Lorenz Curves</a></div>
257
           <div class="example-link"><a class="example-link" href="mekkoCharts.html">Mekko Charts</a></div>
258
           <div class="example-link"><a class="example-link" href="meterGauge.html">Meter Gauge</a></div>
259
           <div class="example-link"><a class="example-link" href="candlestick-charts.html">Open Hi Low Close and Candlestick Charts</a></div>
260
           <div class="example-link"><a class="example-link" href="pieTest.html">Pie Charts and Options</a></div>
261
           <div class="example-link"><a class="example-link" href="pieTest4.html">Pie Charts and Options 2</a></div>
262
           <div class="example-link"><a class="example-link" href="pie-donut-charts.html">Pie and Donut Charts</a></div>
263
           <div class="example-link"><a class="example-link" href="selectorSyntax.html">Plot Creation with jQuery Selectors</a></div>
264
           <div class="example-link"><a class="example-link" href="zooming.html">Plot Zooming and Cursor Control</a></div>
265
           <div class="example-link"><a class="example-link" href="kcp_pdf.html">Probability Density Function Chart</a></div>
266
           <div class="example-link"><a class="example-link" href="kcp_pyramid_by_age.html">Pyramid Chart By Age</a></div>
267
           <div class="example-link"><a class="example-link" href="kcp_pyramid.html">Pyramid Charts</a></div>
268
           <div class="example-link"><a class="example-link" href="kcp_pyramid2.html">Pyramid Charts 2</a></div>
269
           <div class="example-link"><a class="example-link" href="kcp_quintiles.html">Quintile Pyramid Charts</a></div>
270
           <div class="example-link"><a class="example-link" href="resizablePlot.html">Resizable Plots</a></div>
271
           <div class="example-link"><a class="example-link" href="rotated-tick-labels.html">Rotated Labels and Font Styling</a></div>
272
           <div class="example-link"><a class="example-link" href="smoothedLine.html">Smoothed Lines</a></div>
273
           <div class="example-link"><a class="example-link" href="bar-charts.html">Vertical and Horizontal Bar Charts</a></div>
274
           <div class="example-link"><a class="example-link" href="waterfall.html">Waterfall Charts</a></div>
275
           <div class="example-link"><a class="example-link" href="waterfall2.html">Waterfall Charts 2</a></div>
276
           <div class="example-link"><a class="example-link" href="zoomOptions.html">Zoom Options</a></div>
277
           <div class="example-link"><a class="example-link" href="zoomProxy.html">Zoom Proxy - Control one plot from another</a></div>
278
           <div class="example-link"><a class="example-link" href="zoom1.html">Zooming</a></div>
279
           <div class="example-link"><a class="example-link" href="dateAxisLogAxisZooming.html">Zooming with Date and Log Axes</a></div>
280
 
281
         </div>
282
               </div>
283
    </div>
284
    <script type="text/javascript" src="example.min.js"></script>
285
 
286
</body>
287
 
288
 
289
</html>