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>Data Point Highlighting, Tooltips and Cursor Tracking</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
<p>The Highlighter plugin will highlight data points near the mouse and display an optional tooltip with the data point value.  By default, the tooltip values will be formatted with the same formatter as used to display the axes tick values.  The text format can be customized with an optional sprintf style format string.</p>
36
 
37
<div id="chart1" style="height:300px; width:600px;"></div>
38
 
39
<pre class="code prettyprint brush: js"></pre>
40
 
41
<p>The Cursor plugin changes the mouse cursor when it enters the graph area and displays an optional tooltip with the mouse position.  The tooltip can be in a fixed location, or it can follow the mouse.  The pointer style, set to "crosshair" by default, can also be customized.  Tooltip values are formatted similar to the Highlighter plugin.  By default they use the axes formatters, but can be customized with a sprintf format string.</p>
42
 
43
<div id="chart2" style="height:300px; width:600px;"></div>
44
 
45
<pre class="code prettyprint brush: js"></pre>
46
 
47
<p>Tooltips can be displayed with Pie Charts.  Cursor tracking doesn't work with Pie Charts since they do not have points or axes, so the tooltip is based on the highlighter and always follows the mouse.  You may wish to change the background and border colors of the highlighter tooltip for use with Pie Charts, since the default tooltip colors are designed to be displayed on top of a white background, while the Pie Chart slices provide a darker color background for the tooltips.  To change the tooltip colors or other attributes, modify the jqplot-highlighter-tooltip class in jquery.jqplot.min.css.</p>
48
 
49
<div id="chart3" style="height:300px; width:600px;"></div>
50
 
51
<pre class="code prettyprint brush: js"></pre>
52
 
53
<script class="code" type="text/javascript">
54
$(document).ready(function(){
55
  var line1=[['23-May-08', 578.55], ['20-Jun-08', 566.5], ['25-Jul-08', 480.88], ['22-Aug-08', 509.84],
56
      ['26-Sep-08', 454.13], ['24-Oct-08', 379.75], ['21-Nov-08', 303], ['26-Dec-08', 308.56],
57
      ['23-Jan-09', 299.14], ['20-Feb-09', 346.51], ['20-Mar-09', 325.99], ['24-Apr-09', 386.15]];
58
  var plot1 = $.jqplot('chart1', [line1], {
59
      title:'Data Point Highlighting',
60
      axes:{
61
        xaxis:{
62
          renderer:$.jqplot.DateAxisRenderer,
63
          tickOptions:{
64
            formatString:'%b&nbsp;%#d'
65
          }
66
        },
67
        yaxis:{
68
          tickOptions:{
69
            formatString:'$%.2f'
70
            }
71
        }
72
      },
73
      highlighter: {
74
        show: true,
75
        sizeAdjust: 7.5
76
      },
77
      cursor: {
78
        show: false
79
      }
80
  });
81
});
82
</script>
83
 
84
<script class="code" type="text/javascript">
85
$(document).ready(function(){
86
  var line1=[['23-May-08', 578.55], ['20-Jun-08', 566.5], ['25-Jul-08', 480.88], ['22-Aug-08', 509.84],
87
      ['26-Sep-08', 454.13], ['24-Oct-08', 379.75], ['21-Nov-08', 303], ['26-Dec-08', 308.56],
88
      ['23-Jan-09', 299.14], ['20-Feb-09', 346.51], ['20-Mar-09', 325.99], ['24-Apr-09', 386.15]];
89
  var plot2 = $.jqplot('chart2', [line1], {
90
    title:'Mouse Cursor Tracking',
91
    axes:{
92
      xaxis:{
93
        renderer:$.jqplot.DateAxisRenderer,
94
          tickOptions:{
95
            formatString:'%b&nbsp;%#d'
96
          }
97
      },
98
      yaxis:{
99
        tickOptions:{
100
          formatString:'$%.2f'
101
        }
102
      }
103
    },
104
    highlighter: {
105
      show: false
106
    },
107
    cursor: {
108
      show: true,
109
      tooltipLocation:'sw'
110
    }
111
  });
112
});
113
</script>
114
 
115
<script class="code" type="text/javascript">
116
$(document).ready(function() {
117
  var line1 = [['Sony',7], ['Samsung',13.3], ['LG',14.7],
118
    ['Vizio',5.2], ['Insignia', 1.2]];
119
 
120
  var plot3 = $.jqplot('chart3', [line1], {
121
    title: 'Pie Chart with Tooltips',
122
    seriesDefaults: {
123
      renderer: $.jqplot.PieRenderer,
124
      rendererOptions: {
125
        showDataLabels: true,
126
        padding: 10,
127
        sliceMargin: 6,
128
        shadow: false
129
      }
130
    },
131
    legend: {
132
      show: true
133
    },
134
    highlighter: {
135
      show: true,
136
      useAxesFormatters: false,
137
      tooltipFormatString: '%s'
138
    }
139
 
140
  });
141
 
142
});
143
 
144
 
145
<!-- End example scripts -->
146
 
147
<!-- Don't touch this! -->
148
 
149
 
150
    <script class="include" type="text/javascript" src="../jquery.jqplot.min.js"></script>
151
    <script type="text/javascript" src="syntaxhighlighter/scripts/shCore.min.js"></script>
152
    <script type="text/javascript" src="syntaxhighlighter/scripts/shBrushJScript.min.js"></script>
153
    <script type="text/javascript" src="syntaxhighlighter/scripts/shBrushXml.min.js"></script>
154
<!-- End Don't touch this! -->
155
 
156
<!-- Additional plugins go here -->
157
 
158
    <script class="include" language="javascript" type="text/javascript" src="../plugins/jqplot.highlighter.min.js"></script>
159
    <script class="include" language="javascript" type="text/javascript" src="../plugins/jqplot.cursor.min.js"></script>
160
    <script class="include" language="javascript" type="text/javascript" src="../plugins/jqplot.dateAxisRenderer.min.js"></script>
161
 
162
<!-- End additional plugins -->
163
 
164
        </div>
165
         <div class="col2">
166
 
167
           <div class="example-link"><a class="example-link" href="data-renderers.html">AJAX and JSON Data Loading via Data Renderers</a></div>
168
           <div class="example-link"><a class="example-link" href="barLineAnimated.html">Animated Charts</a></div>
169
           <div class="example-link"><a class="example-link" href="dashboardWidget.html">Animated Dashboard Sample - Filled Line with Log Axis</a></div>
170
           <div class="example-link"><a class="example-link" href="kcp_area.html">Area Chart</a></div>
171
           <div class="example-link"><a class="example-link" href="kcp_area2.html">Area Chart 2</a></div>
172
           <div class="example-link"><a class="example-link" href="axisLabelTests.html">Axis Labels</a></div>
173
           <div class="example-link"><a class="example-link" href="axisLabelsRotatedText.html">Axis Labels and Rotated Text</a></div>
174
           <div class="example-link"><a class="example-link" href="barTest.html">Bar Charts</a></div>
175
           <div class="example-link"><a class="example-link" href="multipleBarColors.html">Bar Colors Example</a></div>
176
           <div class="example-link"><a class="example-link" href="bezierCurve.html">Bezier Curve Plots</a></div>
177
           <div class="example-link"><a class="example-link" href="blockPlot.html">Block Plots</a></div>
178
           <div class="example-link"><a class="example-link" href="bubbleChart.html">Bubble Charts</a></div>
179
           <div class="example-link"><a class="example-link" href="bubble-plots.html">Bubble Plots</a></div>
180
           <div class="example-link"><a class="example-link" href="candlestick.html">Candlestick and Open Hi Low Close Charts</a></div>
181
           <div class="example-link"><a class="example-link" href="theming.html">Chart Theming</a></div>
182
           <div class="example-link"><a class="example-link" href="fillBetweenLines.html">Charts with Fill Between Lines</a></div>
183
           <div class="example-link"><a class="example-link" href="kcp_cdf.html">Cumulative Density Function Chart</a></div>
184
           <div class="example-link"><a class="example-link" href="dashedLines.html">Dashed Lines with Smoothing</a></div>
185
           <div class="example-link"><a class="example-link" href="cursor-highlighter.html">Data Point Highlighting, Tooltips and Cursor Tracking</a></div>
186
           <div class="example-link"><a class="example-link" href="point-labels.html">Data Point labels</a></div>
187
           <div class="example-link"><a class="example-link" href="date-axes.html">Date Axes</a></div>
188
           <div class="example-link"><a class="example-link" href="dateAxisRenderer.html">Date Axes 2</a></div>
189
           <div class="example-link"><a class="example-link" href="rotatedTickLabelsZoom.html">Date Axes, Rotated Labels and Zooming</a></div>
190
           <div class="example-link"><a class="example-link" href="canvas-overlay.html">Draw Lines on Plots - Canvas Overlay</a></div>
191
           <div class="example-link"><a class="example-link" href="draw-rectangles.html">Draw Rectangles on Plots</a></div>
192
           <div class="example-link"><a class="example-link" href="kcp_engel.html">Engel Curves</a></div>
193
           <div class="example-link"><a class="example-link" href="bandedLine.html">Error Bands and Confidence Intervals</a></div>
194
           <div class="example-link"><a class="example-link" href="area.html">Filled (Area) Charts</a></div>
195
           <div class="example-link"><a class="example-link" href="axisScalingForceTickAt.html">Force Plot to Have Tick at 0 or 100</a></div>
196
           <div class="example-link"><a class="example-link" href="hiddenPlotsInTabs.html">Hidden Plots</a></div>
197
           <div class="example-link"><a class="example-link" href="customHighlighterCursorTrendline.html">Highlighting, Dragging Points, Cursor and Trend Lines</a></div>
198
           <div class="example-link"><a class="example-link" href="line-charts.html">Line Charts and Options</a></div>
199
           <div class="example-link"><a class="example-link" href="kcp_lorenz.html">Lorenz Curves</a></div>
200
           <div class="example-link"><a class="example-link" href="mekkoCharts.html">Mekko Charts</a></div>
201
           <div class="example-link"><a class="example-link" href="meterGauge.html">Meter Gauge</a></div>
202
           <div class="example-link"><a class="example-link" href="candlestick-charts.html">Open Hi Low Close and Candlestick Charts</a></div>
203
           <div class="example-link"><a class="example-link" href="pieTest.html">Pie Charts and Options</a></div>
204
           <div class="example-link"><a class="example-link" href="pieTest4.html">Pie Charts and Options 2</a></div>
205
           <div class="example-link"><a class="example-link" href="pie-donut-charts.html">Pie and Donut Charts</a></div>
206
           <div class="example-link"><a class="example-link" href="selectorSyntax.html">Plot Creation with jQuery Selectors</a></div>
207
           <div class="example-link"><a class="example-link" href="zooming.html">Plot Zooming and Cursor Control</a></div>
208
           <div class="example-link"><a class="example-link" href="kcp_pdf.html">Probability Density Function Chart</a></div>
209
           <div class="example-link"><a class="example-link" href="kcp_pyramid_by_age.html">Pyramid Chart By Age</a></div>
210
           <div class="example-link"><a class="example-link" href="kcp_pyramid.html">Pyramid Charts</a></div>
211
           <div class="example-link"><a class="example-link" href="kcp_pyramid2.html">Pyramid Charts 2</a></div>
212
           <div class="example-link"><a class="example-link" href="kcp_quintiles.html">Quintile Pyramid Charts</a></div>
213
           <div class="example-link"><a class="example-link" href="resizablePlot.html">Resizable Plots</a></div>
214
           <div class="example-link"><a class="example-link" href="rotated-tick-labels.html">Rotated Labels and Font Styling</a></div>
215
           <div class="example-link"><a class="example-link" href="smoothedLine.html">Smoothed Lines</a></div>
216
           <div class="example-link"><a class="example-link" href="bar-charts.html">Vertical and Horizontal Bar Charts</a></div>
217
           <div class="example-link"><a class="example-link" href="waterfall.html">Waterfall Charts</a></div>
218
           <div class="example-link"><a class="example-link" href="waterfall2.html">Waterfall Charts 2</a></div>
219
           <div class="example-link"><a class="example-link" href="zoomOptions.html">Zoom Options</a></div>
220
           <div class="example-link"><a class="example-link" href="zoomProxy.html">Zoom Proxy - Control one plot from another</a></div>
221
           <div class="example-link"><a class="example-link" href="zoom1.html">Zooming</a></div>
222
           <div class="example-link"><a class="example-link" href="dateAxisLogAxisZooming.html">Zooming with Date and Log Axes</a></div>
223
 
224
         </div>
225
               </div>
226
    </div>
227
    <script type="text/javascript" src="example.min.js"></script>
228
 
229
</body>
230
 
231
 
232
</html>