Subversion-Projekte lars-tiefland.ci

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
875 lars 1
<!DOCTYPE html>
2
 
3
<html>
4
<head>
5
 
6
    <title>Data Point labels</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
<style type="text/css">
34
#chart3 .jqplot-point-label {
35
  border: 1.5px solid #aaaaaa;
36
  padding: 1px 3px;
37
  background-color: #eeccdd;
38
}
39
</style>
40
 
41
<!-- Example scripts go here -->
42
<P>The pointLabels plugin places labels on the plot at the data point locations.  Labeles can use the series data array or a separate labels array.  If using the series data, the last value in the data point array is used as the label by default.</p>
43
 
44
<div id="chart1" style="height:300px; width:500px;"></div>
45
 
46
<pre class="code prettyprint brush: js"></pre>
47
 
48
<P>Additional data can be added to the series and it will be used for labels. If additional data is provided, each data point must have a value for the label, even if it is "null".</p>
49
 
50
<div id="chart2" style="height:300px; width:500px;"></div>
51
 
52
<pre class="code prettyprint brush: js"></pre>
53
 
54
<P>Labels work with Bar charts as well.  Here, the Labels have been supplied through the "labels" array on the "pointLabels" option to the series.  Also, additional css styling has been provided to the labels.</p>
55
 
56
<div id="chart3" style="height:300px; width:500px;"></div>
57
 
58
<pre class="prettyprint brush: html">
59
<style type="text/css">
60
#chart3 .jqplot-point-label {
61
  border: 1.5px solid #aaaaaa;
62
  padding: 1px 3px;
63
  background-color: #eeccdd;
64
}
65
</style>
66
</pre>
67
<pre class="code prettyprint brush: js"></pre>
68
 
69
<P>Point labels can be used on stacked bar charts.  If no labels array is specified, they will use data from the chart.  Values can be displayed individually for each series (stackedValue option is false, the default), or cumulative values for all series can be displayed (stackedValue option is true).</p>
70
 
71
<div id="chart4" style="height:300px; width:500px;"></div>
72
 
73
<pre class="code prettyprint brush: js"></pre>
74
 
75
<P>Data point labels have an "edgeTolerance" option.  This options controls how close the data point label can be to an axis edge and still be drawn.  The default of 0 allows labels to touch the axis.  Positive values will increase the required distance between the axis and label, negative values will allow labels to overlap axes.</p>
76
 
77
<div id="chart5" style="height:300px; width:500px;"></div>
78
 
79
<pre class="code prettyprint brush: js"></pre>
80
 
81
<script class="code" type="text/javascript">
82
$(document).ready(function(){
83
  var line1 = [14, 32, 41, 44, 40, 47, 53, 67];
84
  var plot1 = $.jqplot('chart1', [line1], {
85
      title: 'Chart with Point Labels',
86
      seriesDefaults: {
87
        showMarker:false,
88
        pointLabels: { show:true }
89
      }
90
  });
91
});
92
</script>
93
 
94
 
95
<script class="code" type="text/javascript">
96
$(document).ready(function(){
97
  var line1 = [[-12, 7, null], [-3, 14, null], [2, -1, '(low)'],
98
      [7, -1, '(low)'], [11, 11, null], [13, -1, '(low)']];
99
  var plot2 = $.jqplot('chart2', [line1], {
100
    title: 'Point Labels From Extra Series Data',
101
    seriesDefaults: {
102
      showMarker:false,
103
      pointLabels:{ show:true, location:'s', ypadding:3 }
104
    },
105
    axes:{ yaxis:{ pad: 1.3 } }
106
  });
107
});
108
</script>
109
 
110
 
111
<script class="code" type="text/javascript">
112
$(document).ready(function(){
113
  var line1 = [14, 32, 41, 44, 40];
114
  var plot3 = $.jqplot('chart3', [line1], {
115
    title: 'Bar Chart with Point Labels',
116
    seriesDefaults: {renderer: $.jqplot.BarRenderer},
117
    series:[
118
     {pointLabels:{
119
        show: true,
120
        labels:['fourteen', 'thirty two', 'fourty one', 'fourty four', 'fourty']
121
      }}],
122
    axes: {
123
      xaxis:{renderer:$.jqplot.CategoryAxisRenderer},
124
      yaxis:{padMax:1.3}}
125
  });
126
});
127
</script>
128
 
129
<script class="code" type="text/javascript">
130
$(document).ready(function(){
131
  var line1 = [14, 32, 41, 44, 40, 37, 29];
132
  var line2 = [7, 12, 15, 17, 20, 27, 39];
133
  var plot4 = $.jqplot('chart4', [line1, line2], {
134
      title: 'Stacked Bar Chart with Cumulative Point Labels',
135
      stackSeries: true,
136
      seriesDefaults: {
137
          renderer: $.jqplot.BarRenderer,
138
          rendererOptions:{barMargin: 25},
139
          pointLabels:{show:true, stackedValue: true}
140
      },
141
      axes: {
142
          xaxis:{renderer:$.jqplot.CategoryAxisRenderer}
143
      }
144
  });
145
});
146
</script>
147
 
148
 
149
<script class="code" type="text/javascript">
150
$(document).ready(function(){
151
  var line1 = [14, 32, 41, 44, 40, 47, 53, 67];
152
  var plot5 = $.jqplot('chart5', [line1], {
153
      title: 'Chart with Point Labels',
154
      seriesDefaults: {
155
        showMarker:false,
156
        pointLabels: {
157
          show: true,
158
          edgeTolerance: 5
159
        }},
160
      axes:{
161
        xaxis:{min:3}
162
      }
163
  });
164
});
165
</script>
166
 
167
<!-- End example scripts -->
168
 
169
<!-- Don't touch this! -->
170
 
171
 
172
    <script class="include" type="text/javascript" src="../jquery.jqplot.min.js"></script>
173
    <script type="text/javascript" src="syntaxhighlighter/scripts/shCore.min.js"></script>
174
    <script type="text/javascript" src="syntaxhighlighter/scripts/shBrushJScript.min.js"></script>
175
    <script type="text/javascript" src="syntaxhighlighter/scripts/shBrushXml.min.js"></script>
176
<!-- End Don't touch this! -->
177
 
178
<!-- Additional plugins go here -->
179
    <script class="include" language="javascript" type="text/javascript" src="../plugins/jqplot.barRenderer.min.js"></script>
180
    <script class="include" language="javascript" type="text/javascript" src="../plugins/jqplot.categoryAxisRenderer.min.js"></script>
181
    <script class="include" language="javascript" type="text/javascript" src="../plugins/jqplot.pointLabels.min.js"></script>
182
 
183
<!-- End additional plugins -->
184
 
185
        </div>
186
         <div class="col2">
187
 
188
           <div class="example-link"><a class="example-link" href="data-renderers.html">AJAX and JSON Data Loading via Data Renderers</a></div>
189
           <div class="example-link"><a class="example-link" href="barLineAnimated.html">Animated Charts</a></div>
190
           <div class="example-link"><a class="example-link" href="dashboardWidget.html">Animated Dashboard Sample - Filled Line with Log Axis</a></div>
191
           <div class="example-link"><a class="example-link" href="kcp_area.html">Area Chart</a></div>
192
           <div class="example-link"><a class="example-link" href="kcp_area2.html">Area Chart 2</a></div>
193
           <div class="example-link"><a class="example-link" href="axisLabelTests.html">Axis Labels</a></div>
194
           <div class="example-link"><a class="example-link" href="axisLabelsRotatedText.html">Axis Labels and Rotated Text</a></div>
195
           <div class="example-link"><a class="example-link" href="barTest.html">Bar Charts</a></div>
196
           <div class="example-link"><a class="example-link" href="multipleBarColors.html">Bar Colors Example</a></div>
197
           <div class="example-link"><a class="example-link" href="bezierCurve.html">Bezier Curve Plots</a></div>
198
           <div class="example-link"><a class="example-link" href="blockPlot.html">Block Plots</a></div>
199
           <div class="example-link"><a class="example-link" href="bubbleChart.html">Bubble Charts</a></div>
200
           <div class="example-link"><a class="example-link" href="bubble-plots.html">Bubble Plots</a></div>
201
           <div class="example-link"><a class="example-link" href="candlestick.html">Candlestick and Open Hi Low Close Charts</a></div>
202
           <div class="example-link"><a class="example-link" href="theming.html">Chart Theming</a></div>
203
           <div class="example-link"><a class="example-link" href="fillBetweenLines.html">Charts with Fill Between Lines</a></div>
204
           <div class="example-link"><a class="example-link" href="kcp_cdf.html">Cumulative Density Function Chart</a></div>
205
           <div class="example-link"><a class="example-link" href="dashedLines.html">Dashed Lines with Smoothing</a></div>
206
           <div class="example-link"><a class="example-link" href="cursor-highlighter.html">Data Point Highlighting, Tooltips and Cursor Tracking</a></div>
207
           <div class="example-link"><a class="example-link" href="point-labels.html">Data Point labels</a></div>
208
           <div class="example-link"><a class="example-link" href="date-axes.html">Date Axes</a></div>
209
           <div class="example-link"><a class="example-link" href="dateAxisRenderer.html">Date Axes 2</a></div>
210
           <div class="example-link"><a class="example-link" href="rotatedTickLabelsZoom.html">Date Axes, Rotated Labels and Zooming</a></div>
211
           <div class="example-link"><a class="example-link" href="canvas-overlay.html">Draw Lines on Plots - Canvas Overlay</a></div>
212
           <div class="example-link"><a class="example-link" href="draw-rectangles.html">Draw Rectangles on Plots</a></div>
213
           <div class="example-link"><a class="example-link" href="kcp_engel.html">Engel Curves</a></div>
214
           <div class="example-link"><a class="example-link" href="bandedLine.html">Error Bands and Confidence Intervals</a></div>
215
           <div class="example-link"><a class="example-link" href="area.html">Filled (Area) Charts</a></div>
216
           <div class="example-link"><a class="example-link" href="axisScalingForceTickAt.html">Force Plot to Have Tick at 0 or 100</a></div>
217
           <div class="example-link"><a class="example-link" href="hiddenPlotsInTabs.html">Hidden Plots</a></div>
218
           <div class="example-link"><a class="example-link" href="customHighlighterCursorTrendline.html">Highlighting, Dragging Points, Cursor and Trend Lines</a></div>
219
           <div class="example-link"><a class="example-link" href="line-charts.html">Line Charts and Options</a></div>
220
           <div class="example-link"><a class="example-link" href="kcp_lorenz.html">Lorenz Curves</a></div>
221
           <div class="example-link"><a class="example-link" href="mekkoCharts.html">Mekko Charts</a></div>
222
           <div class="example-link"><a class="example-link" href="meterGauge.html">Meter Gauge</a></div>
223
           <div class="example-link"><a class="example-link" href="candlestick-charts.html">Open Hi Low Close and Candlestick Charts</a></div>
224
           <div class="example-link"><a class="example-link" href="pieTest.html">Pie Charts and Options</a></div>
225
           <div class="example-link"><a class="example-link" href="pieTest4.html">Pie Charts and Options 2</a></div>
226
           <div class="example-link"><a class="example-link" href="pie-donut-charts.html">Pie and Donut Charts</a></div>
227
           <div class="example-link"><a class="example-link" href="selectorSyntax.html">Plot Creation with jQuery Selectors</a></div>
228
           <div class="example-link"><a class="example-link" href="zooming.html">Plot Zooming and Cursor Control</a></div>
229
           <div class="example-link"><a class="example-link" href="kcp_pdf.html">Probability Density Function Chart</a></div>
230
           <div class="example-link"><a class="example-link" href="kcp_pyramid_by_age.html">Pyramid Chart By Age</a></div>
231
           <div class="example-link"><a class="example-link" href="kcp_pyramid.html">Pyramid Charts</a></div>
232
           <div class="example-link"><a class="example-link" href="kcp_pyramid2.html">Pyramid Charts 2</a></div>
233
           <div class="example-link"><a class="example-link" href="kcp_quintiles.html">Quintile Pyramid Charts</a></div>
234
           <div class="example-link"><a class="example-link" href="resizablePlot.html">Resizable Plots</a></div>
235
           <div class="example-link"><a class="example-link" href="rotated-tick-labels.html">Rotated Labels and Font Styling</a></div>
236
           <div class="example-link"><a class="example-link" href="smoothedLine.html">Smoothed Lines</a></div>
237
           <div class="example-link"><a class="example-link" href="bar-charts.html">Vertical and Horizontal Bar Charts</a></div>
238
           <div class="example-link"><a class="example-link" href="waterfall.html">Waterfall Charts</a></div>
239
           <div class="example-link"><a class="example-link" href="waterfall2.html">Waterfall Charts 2</a></div>
240
           <div class="example-link"><a class="example-link" href="zoomOptions.html">Zoom Options</a></div>
241
           <div class="example-link"><a class="example-link" href="zoomProxy.html">Zoom Proxy - Control one plot from another</a></div>
242
           <div class="example-link"><a class="example-link" href="zoom1.html">Zooming</a></div>
243
           <div class="example-link"><a class="example-link" href="dateAxisLogAxisZooming.html">Zooming with Date and Log Axes</a></div>
244
 
245
         </div>
246
               </div>
247
    </div>
248
    <script type="text/javascript" src="example.min.js"></script>
249
 
250
</body>
251
 
252
 
253
</html>