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>Rotated Labels and Font Styling</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>Rotated axis tick labels are possible through the "jqplot.canvasTextRenderer.min.js" and "jqplot.canvasAxisTickRenderer.min.js" plugins. Native canvas font rendering capabilities are used in supported browsers.  This includes most recent browsers (including IE 9).  In browsers which don't support native canvas font text, text is rendered in the Hershey font.</p>
36
 
37
<div id="chart1" style="height:300px; width:500px;"></div>
38
 
39
<pre class="code prettyprint brush: js"></pre>
40
 
41
 
42
 
43
<p>For comparison, here is the same graph with the "fontFamily" and "fontSize" set.  If you have a supported browser, you should see a difference in label fonts.</p>
44
 
45
<div id="chart1b" style="height:300px; width:500px;"></div>
46
 
47
<pre class="code prettyprint brush: js"></pre>
48
 
49
 
50
<p>The default positioning applies to either primary or secondary axes and accounts for label rotation to ensure that the labels point to the appropriate bar or tick position.</p>
51
 
52
<p>Also note here the use of the "autoscale" option on the y axes.  Turning this option on will force the y axes to line up tick marks for consistend grid lines across the grid.</p>
53
 
54
<div id="chart2" style="height:300px; width:500px;"></div>
55
 
56
<pre class="code prettyprint brush: js"></pre>
57
 
58
 
59
<p>You can override the default position by specifying a labelPosition of 'start', 'middle' or 'end'. The results probably are not as pleasing as the default 'auto' setting.</p>
60
 
61
<div id="chart3" style="height:300px; width:500px;"></div>
62
 
63
<pre class="code prettyprint brush: js"></pre>
64
 
65
 
66
<script class="code" type="text/javascript">
67
$(document).ready(function(){
68
  var line1 = [['Cup Holder Pinion Bob', 7], ['Generic Fog Lamp', 9], ['HDTV Receiver', 15],
69
  ['8 Track Control Module', 12], [' Sludge Pump Fourier Modulator', 3],
70
  ['Transcender/Spice Rack', 6], ['Hair Spray Danger Indicator', 18]];
71
 
72
  var plot1 = $.jqplot('chart1', [line1], {
73
    title: 'Concern vs. Occurrance',
74
    series:[{renderer:$.jqplot.BarRenderer}],
75
    axesDefaults: {
76
        tickRenderer: $.jqplot.CanvasAxisTickRenderer ,
77
        tickOptions: {
78
          angle: -30,
79
          fontSize: '10pt'
80
        }
81
    },
82
    axes: {
83
      xaxis: {
84
        renderer: $.jqplot.CategoryAxisRenderer
85
      }
86
    }
87
  });
88
});
89
</script>
90
 
91
 
92
<script class="code" type="text/javascript">
93
$(document).ready(function(){
94
  var line1 = [['Cup Holder Pinion Bob', 7], ['Generic Fog Lamp', 9], ['HDTV Receiver', 15],
95
  ['8 Track Control Module', 12], [' Sludge Pump Fourier Modulator', 3],
96
  ['Transcender/Spice Rack', 6], ['Hair Spray Danger Indicator', 18]];
97
  var plot1b = $.jqplot('chart1b', [line1], {
98
    title: 'Concern vs. Occurrance',
99
    series:[{renderer:$.jqplot.BarRenderer}],
100
    axesDefaults: {
101
        tickRenderer: $.jqplot.CanvasAxisTickRenderer ,
102
        tickOptions: {
103
          fontFamily: 'Georgia',
104
          fontSize: '10pt',
105
          angle: -30
106
        }
107
    },
108
    axes: {
109
      xaxis: {
110
        renderer: $.jqplot.CategoryAxisRenderer
111
      }
112
    }
113
  });
114
});
115
</script>
116
 
117
 
118
<script class="code" type="text/javascript">
119
$(document).ready(function(){
120
  var line1 = [['Cup Holder Pinion Bob', 7], ['Generic Fog Lamp', 9], ['HDTV Receiver', 15],
121
  ['8 Track Control Module', 12], [' Sludge Pump Fourier Modulator', 3],
122
  ['Transcender/Spice Rack', 6], ['Hair Spray Danger Indicator', 18]];
123
  var line2 = [['Nickle', 28], ['Aluminum', 13], ['Xenon', 54], ['Silver', 47],
124
  ['Sulfer', 16], ['Silicon', 14], ['Vanadium', 23]];
125
 
126
  var plot2 = $.jqplot('chart2', [line1, line2], {
127
    series:[{renderer:$.jqplot.BarRenderer}, {xaxis:'x2axis', yaxis:'y2axis'}],
128
    axesDefaults: {
129
        tickRenderer: $.jqplot.CanvasAxisTickRenderer ,
130
        tickOptions: {
131
          angle: 30
132
        }
133
    },
134
    axes: {
135
      xaxis: {
136
        renderer: $.jqplot.CategoryAxisRenderer
137
      },
138
      x2axis: {
139
        renderer: $.jqplot.CategoryAxisRenderer
140
      },
141
      yaxis: {
142
        autoscale:true
143
      },
144
      y2axis: {
145
        autoscale:true
146
      }
147
    }
148
  });
149
});
150
</script>
151
 
152
<script class="code" type="text/javascript">
153
$(document).ready(function(){
154
  var line1 = [['Cup Holder Pinion Bob', 7], ['Generic Fog Lamp', 9], ['HDTV Receiver', 15],
155
  ['8 Track Control Module', 12], [' Sludge Pump Fourier Modulator', 3],
156
  ['Transcender/Spice Rack', 6], ['Hair Spray Danger Indicator', 18]];
157
  var plot3 = $.jqplot('chart3', [line1], {
158
    title: 'Concern vs. Occurrance',
159
    series:[{renderer:$.jqplot.BarRenderer}],
160
    axesDefaults: {
161
        tickRenderer: $.jqplot.CanvasAxisTickRenderer,
162
        tickOptions: {
163
          angle: -30
164
        }
165
    },
166
    axes: {
167
      xaxis: {
168
        renderer: $.jqplot.CategoryAxisRenderer,
169
        tickOptions: {
170
          labelPosition: 'middle'
171
        }
172
      },
173
      yaxis: {
174
        autoscale:true,
175
        tickRenderer: $.jqplot.CanvasAxisTickRenderer,
176
        tickOptions: {
177
          labelPosition: 'start'
178
        }
179
      }
180
    }
181
  });
182
});
183
</script>
184
 
185
 
186
 
187
<!-- End example scripts -->
188
 
189
<!-- Don't touch this! -->
190
 
191
 
192
    <script class="include" type="text/javascript" src="../jquery.jqplot.min.js"></script>
193
    <script type="text/javascript" src="syntaxhighlighter/scripts/shCore.min.js"></script>
194
    <script type="text/javascript" src="syntaxhighlighter/scripts/shBrushJScript.min.js"></script>
195
    <script type="text/javascript" src="syntaxhighlighter/scripts/shBrushXml.min.js"></script>
196
<!-- End Don't touch this! -->
197
 
198
<!-- Additional plugins go here -->
199
 
200
  <script class="include" language="javascript" type="text/javascript" src="../plugins/jqplot.dateAxisRenderer.min.js"></script>
201
  <script class="include" language="javascript" type="text/javascript" src="../plugins/jqplot.canvasTextRenderer.min.js"></script>
202
  <script class="include" language="javascript" type="text/javascript" src="../plugins/jqplot.canvasAxisTickRenderer.min.js"></script>
203
  <script class="include" language="javascript" type="text/javascript" src="../plugins/jqplot.categoryAxisRenderer.min.js"></script>
204
  <script class="include" language="javascript" type="text/javascript" src="../plugins/jqplot.barRenderer.min.js"></script>
205
 
206
<!-- End additional plugins -->
207
 
208
        </div>
209
         <div class="col2">
210
 
211
           <div class="example-link"><a class="example-link" href="data-renderers.html">AJAX and JSON Data Loading via Data Renderers</a></div>
212
           <div class="example-link"><a class="example-link" href="barLineAnimated.html">Animated Charts</a></div>
213
           <div class="example-link"><a class="example-link" href="dashboardWidget.html">Animated Dashboard Sample - Filled Line with Log Axis</a></div>
214
           <div class="example-link"><a class="example-link" href="kcp_area.html">Area Chart</a></div>
215
           <div class="example-link"><a class="example-link" href="kcp_area2.html">Area Chart 2</a></div>
216
           <div class="example-link"><a class="example-link" href="axisLabelTests.html">Axis Labels</a></div>
217
           <div class="example-link"><a class="example-link" href="axisLabelsRotatedText.html">Axis Labels and Rotated Text</a></div>
218
           <div class="example-link"><a class="example-link" href="barTest.html">Bar Charts</a></div>
219
           <div class="example-link"><a class="example-link" href="multipleBarColors.html">Bar Colors Example</a></div>
220
           <div class="example-link"><a class="example-link" href="bezierCurve.html">Bezier Curve Plots</a></div>
221
           <div class="example-link"><a class="example-link" href="blockPlot.html">Block Plots</a></div>
222
           <div class="example-link"><a class="example-link" href="bubbleChart.html">Bubble Charts</a></div>
223
           <div class="example-link"><a class="example-link" href="bubble-plots.html">Bubble Plots</a></div>
224
           <div class="example-link"><a class="example-link" href="candlestick.html">Candlestick and Open Hi Low Close Charts</a></div>
225
           <div class="example-link"><a class="example-link" href="theming.html">Chart Theming</a></div>
226
           <div class="example-link"><a class="example-link" href="fillBetweenLines.html">Charts with Fill Between Lines</a></div>
227
           <div class="example-link"><a class="example-link" href="kcp_cdf.html">Cumulative Density Function Chart</a></div>
228
           <div class="example-link"><a class="example-link" href="dashedLines.html">Dashed Lines with Smoothing</a></div>
229
           <div class="example-link"><a class="example-link" href="cursor-highlighter.html">Data Point Highlighting, Tooltips and Cursor Tracking</a></div>
230
           <div class="example-link"><a class="example-link" href="point-labels.html">Data Point labels</a></div>
231
           <div class="example-link"><a class="example-link" href="date-axes.html">Date Axes</a></div>
232
           <div class="example-link"><a class="example-link" href="dateAxisRenderer.html">Date Axes 2</a></div>
233
           <div class="example-link"><a class="example-link" href="rotatedTickLabelsZoom.html">Date Axes, Rotated Labels and Zooming</a></div>
234
           <div class="example-link"><a class="example-link" href="canvas-overlay.html">Draw Lines on Plots - Canvas Overlay</a></div>
235
           <div class="example-link"><a class="example-link" href="draw-rectangles.html">Draw Rectangles on Plots</a></div>
236
           <div class="example-link"><a class="example-link" href="kcp_engel.html">Engel Curves</a></div>
237
           <div class="example-link"><a class="example-link" href="bandedLine.html">Error Bands and Confidence Intervals</a></div>
238
           <div class="example-link"><a class="example-link" href="area.html">Filled (Area) Charts</a></div>
239
           <div class="example-link"><a class="example-link" href="axisScalingForceTickAt.html">Force Plot to Have Tick at 0 or 100</a></div>
240
           <div class="example-link"><a class="example-link" href="hiddenPlotsInTabs.html">Hidden Plots</a></div>
241
           <div class="example-link"><a class="example-link" href="customHighlighterCursorTrendline.html">Highlighting, Dragging Points, Cursor and Trend Lines</a></div>
242
           <div class="example-link"><a class="example-link" href="line-charts.html">Line Charts and Options</a></div>
243
           <div class="example-link"><a class="example-link" href="kcp_lorenz.html">Lorenz Curves</a></div>
244
           <div class="example-link"><a class="example-link" href="mekkoCharts.html">Mekko Charts</a></div>
245
           <div class="example-link"><a class="example-link" href="meterGauge.html">Meter Gauge</a></div>
246
           <div class="example-link"><a class="example-link" href="candlestick-charts.html">Open Hi Low Close and Candlestick Charts</a></div>
247
           <div class="example-link"><a class="example-link" href="pieTest.html">Pie Charts and Options</a></div>
248
           <div class="example-link"><a class="example-link" href="pieTest4.html">Pie Charts and Options 2</a></div>
249
           <div class="example-link"><a class="example-link" href="pie-donut-charts.html">Pie and Donut Charts</a></div>
250
           <div class="example-link"><a class="example-link" href="selectorSyntax.html">Plot Creation with jQuery Selectors</a></div>
251
           <div class="example-link"><a class="example-link" href="zooming.html">Plot Zooming and Cursor Control</a></div>
252
           <div class="example-link"><a class="example-link" href="kcp_pdf.html">Probability Density Function Chart</a></div>
253
           <div class="example-link"><a class="example-link" href="kcp_pyramid_by_age.html">Pyramid Chart By Age</a></div>
254
           <div class="example-link"><a class="example-link" href="kcp_pyramid.html">Pyramid Charts</a></div>
255
           <div class="example-link"><a class="example-link" href="kcp_pyramid2.html">Pyramid Charts 2</a></div>
256
           <div class="example-link"><a class="example-link" href="kcp_quintiles.html">Quintile Pyramid Charts</a></div>
257
           <div class="example-link"><a class="example-link" href="resizablePlot.html">Resizable Plots</a></div>
258
           <div class="example-link"><a class="example-link" href="rotated-tick-labels.html">Rotated Labels and Font Styling</a></div>
259
           <div class="example-link"><a class="example-link" href="smoothedLine.html">Smoothed Lines</a></div>
260
           <div class="example-link"><a class="example-link" href="bar-charts.html">Vertical and Horizontal Bar Charts</a></div>
261
           <div class="example-link"><a class="example-link" href="waterfall.html">Waterfall Charts</a></div>
262
           <div class="example-link"><a class="example-link" href="waterfall2.html">Waterfall Charts 2</a></div>
263
           <div class="example-link"><a class="example-link" href="zoomOptions.html">Zoom Options</a></div>
264
           <div class="example-link"><a class="example-link" href="zoomProxy.html">Zoom Proxy - Control one plot from another</a></div>
265
           <div class="example-link"><a class="example-link" href="zoom1.html">Zooming</a></div>
266
           <div class="example-link"><a class="example-link" href="dateAxisLogAxisZooming.html">Zooming with Date and Log Axes</a></div>
267
 
268
         </div>
269
               </div>
270
    </div>
271
    <script type="text/javascript" src="example.min.js"></script>
272
 
273
</body>
274
 
275
 
276
</html>