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>Line Charts and Options</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 most basic jqPlot chart takes a series of data and plots a line.  No options need to be supplied.  Data is passed in as an array of series.  A series can be either an array of y values or an array of [x,y] data pairs.  If y values only, x values are assigned like 1, 2, 3, ...  Note, for this plot you don't need any plugins.</p>
36
 
37
<div id="chart1" style="height:300px; width:500px;"></div>
38
 
39
<pre class="code prettyprint brush: js"></pre>
40
 
41
 
42
<p>The following plot uses a number of options to set the title, add axis labels, and shows how to use the canvasAxisLabelRenderer plugin to provide rotated axis labels.</p>
43
 
44
<div id="chart2" style="height:300px; width:500px;"></div>
45
 
46
<pre class="code prettyprint brush: js"></pre>
47
 
48
 
49
<p>There are numerous line style options to control how the lines and markers are displayed.</p>
50
 
51
<div id="chart3" style="height:300px; width:500px;"></div>
52
 
53
<pre class="code prettyprint brush: js"></pre>
54
 
55
 
56
<script class="code" type="text/javascript">
57
$(document).ready(function(){
58
  var plot1 = $.jqplot ('chart1', [[3,7,9,1,5,3,8,2,5]]);
59
});
60
</script>
61
 
62
<script class="code" type="text/javascript">
63
$(document).ready(function(){
64
  var plot2 = $.jqplot ('chart2', [[3,7,9,1,5,3,8,2,5]], {
65
      // Give the plot a title.
66
      title: 'Plot With Options',
67
      // You can specify options for all axes on the plot at once with
68
      // the axesDefaults object.  Here, we're using a canvas renderer
69
      // to draw the axis label which allows rotated text.
70
      axesDefaults: {
71
        labelRenderer: $.jqplot.CanvasAxisLabelRenderer
72
      },
73
      // Likewise, seriesDefaults specifies default options for all
74
      // series in a plot.  Options specified in seriesDefaults or
75
      // axesDefaults can be overridden by individual series or
76
      // axes options.
77
      // Here we turn on smoothing for the line.
78
      seriesDefaults: {
79
          rendererOptions: {
80
              smooth: true
81
          }
82
      },
83
      // An axes object holds options for all axes.
84
      // Allowable axes are xaxis, x2axis, yaxis, y2axis, y3axis, ...
85
      // Up to 9 y axes are supported.
86
      axes: {
87
        // options for each axis are specified in seperate option objects.
88
        xaxis: {
89
          label: "X Axis",
90
          // Turn off "padding".  This will allow data point to lie on the
91
          // edges of the grid.  Default padding is 1.2 and will keep all
92
          // points inside the bounds of the grid.
93
          pad: 0
94
        },
95
        yaxis: {
96
          label: "Y Axis"
97
        }
98
      }
99
    });
100
});
101
</script>
102
 
103
<script class="code" type="text/javascript">
104
$(document).ready(function(){
105
  // Some simple loops to build up data arrays.
106
  var cosPoints = [];
107
  for (var i=0; i<2*Math.PI; i+=1){
108
    cosPoints.push([i, Math.cos(i)]);
109
  }
110
 
111
  var sinPoints = [];
112
  for (var i=0; i<2*Math.PI; i+=0.4){
113
     sinPoints.push([i, 2*Math.sin(i-.8)]);
114
  }
115
 
116
  var powPoints1 = [];
117
  for (var i=0; i<2*Math.PI; i+=1) {
118
      powPoints1.push([i, 2.5 + Math.pow(i/4, 2)]);
119
  }
120
 
121
  var powPoints2 = [];
122
  for (var i=0; i<2*Math.PI; i+=1) {
123
      powPoints2.push([i, -2.5 - Math.pow(i/4, 2)]);
124
  }
125
 
126
  var plot3 = $.jqplot('chart3', [cosPoints, sinPoints, powPoints1, powPoints2],
127
    {
128
      title:'Line Style Options',
129
      // Set default options on all series, turn on smoothing.
130
      seriesDefaults: {
131
          rendererOptions: {
132
              smooth: true
133
          }
134
      },
135
      // Series options are specified as an array of objects, one object
136
      // for each series.
137
      series:[
138
          {
139
            // Change our line width and use a diamond shaped marker.
140
            lineWidth:2,
141
            markerOptions: { style:'dimaond' }
142
          },
143
          {
144
            // Don't show a line, just show markers.
145
            // Make the markers 7 pixels with an 'x' style
146
            showLine:false,
147
            markerOptions: { size: 7, style:"x" }
148
          },
149
          {
150
            // Use (open) circlular markers.
151
            markerOptions: { style:"circle" }
152
          },
153
          {
154
            // Use a thicker, 5 pixel line and 10 pixel
155
            // filled square markers.
156
            lineWidth:5,
157
            markerOptions: { style:"filledSquare", size:10 }
158
          }
159
      ]
160
    }
161
  );
162
 
163
});
164
</script>
165
 
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
 
180
  <script class="include" type="text/javascript" src="../plugins/jqplot.canvasTextRenderer.min.js"></script>
181
  <script class="include" type="text/javascript" src="../plugins/jqplot.canvasAxisLabelRenderer.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>