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>Mekko 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
  <style type="text/css" media="screen">
35
    body {
36
        margin: 15px;
37
        font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
38
    }
39
 
40
    p {
41
        margin-top: 20px;
42
        margin-bottom: 20px;
43
    }
44
 
45
    .jqplot-target {
46
        margin: 60px;
47
    }
48
 
49
    pre {
50
        padding: 10px;
51
        background-color: #efead9;
52
        margin: 10px;
53
    }
54
    .jqplot-axis {
55
      font-size: 0.8em;
56
    }
57
 
58
    .jqplot-mekko-barLabel {
59
        font-size: 1em;
60
    }
61
 
62
    #chart2 .jqplot-axis {
63
        font-size: 0.7em;
64
    }
65
 
66
    #chart3 .jqplot-title {
67
        padding-bottom: 40px;
68
    }
69
  </style>
70
<p>Data is specified per bar in the chart.  You can specify data as an array of y values, or as an array of [label, value] pairs.  Note that labels are used only on the first series.  Labels on subsequent series are ignored:</p>
71
<pre>
72
bar1 = [['shirts', 8],['hats', 14],['shoes', 6],['gloves', 16],['dolls', 12]];
73
bar2 = [15,6,9,13,6];
74
bar3 = [['grumpy',4],['sneezy',2],['happy',7],['sleepy',9],['doc',7]];
75
</pre>
76
 
77
  <p>If you want to place labels for each bar under the axis, you use the barLabels option on the axes.  The bar labels can be styled with the ".jqplot-mekko-barLabel" css class.</p>
78
<pre>
79
barLabels = ['Mickey Mouse', 'Donald Duck', 'Goofy'];
80
axes:{xaxis:{barLabels:barLabels}}
81
</pre>
82
 
83
    <div id="chart1" style="width:500px; height:300px;"></div>
84
 
85
    <p>You can add a secondary x axes, and the tick spacing of the axes can be separately controlled with the "tickMode" option.  "bar" will produce tics at bar boundaries, "even" will produce evenly spaced ticks.  If you set the axes max greater than the sum of the data range (the maximum x value), the plot will be padded.  Note that you should set the max on both axes to the same value.</p>
86
 
87
<pre>
88
axes:{
89
    xaxis:{
90
        barLabels:barLabels,
91
        max: 175
92
    },
93
    x2axis:{
94
        show:true,
95
        tickMode:'even',
96
        max: 175
97
    }
98
}
99
</pre>
100
 
101
    <p>Here the borders between chart areas have been given a custom color using the "borderColor" option on the series renderer.</p>
102
 
103
<pre>
104
    seriesDefaults:{renderer:$.jqplot.MekkoRenderer, rendererOptions: {borderColor: '#dddddd'}}
105
</pre>
106
 
107
    <p>Additionally, the legend can be placed "outside" (the default for a mekko chart) or "inside" of the grid area with the "placement" option on the legend renderer.</p>
108
 
109
<pre>
110
legend:{
111
    show:true,
112
    rendererOptions:{placement: "insideGrid"},
113
    location:'e'
114
},
115
</pre>
116
 
117
    <div id="chart2" style="width:500px; height:300px;"></div>
118
 
119
    <p>Legend labels can be specified independently of the series with the "labels" option on the legend.  These will override any labels specified with the series. There are also options to control the number of rows and number of columns in the legend as well as placement.</p>
120
 
121
    <p>Here the legend is positioned to the "north" and set to render 1 row tall (number of columns determined automatically).  Note that an extra css specification was added to pad the bottom of the title of this chart to give room for the legend above the plot.</p>
122
 
123
<pre>
124
legendLabels = ['hotels', 'rides', 'buses', 'instruments', 'totes'];
125
 
126
legend:{
127
    show:true,
128
    location: 'n',
129
    labels: legendLabels,
130
    rendererOptions:{numberRows: 1, placement: "outside"}
131
},
132
</pre>
133
 
134
    <p>Also, the borders between the chart areas have been turned off with the "showBorders: false" option.</p>
135
 
136
<pre>
137
    seriesDefaults:{renderer:$.jqplot.MekkoRenderer, rendererOptions: {showBorders: false}}
138
</pre>
139
 
140
    <div id="chart3" style="width:500px; height:300px;"></div>
141
 
142
<script type="text/javascript" class="code">
143
$(document).ready(function(){
144
    var bar1 = [['shirts', 8],['hats', 14],['shoes', 6],['gloves', 16],['dolls', 12]];
145
    var bar2 = [15,6,9,13,6];
146
    var bar3 = [['grumpy',4],['sneezy',2],['happy',7],['sleepy',9],['doc',7]];
147
    var barLabels = ['Mickey Mouse', 'Donald Duck', 'Goofy'];
148
 
149
    var plot1 = $.jqplot('chart1', [bar1, bar2, bar3], {
150
        title: 'Revenue Breakdown per Character',
151
        seriesDefaults:{renderer:$.jqplot.MekkoRenderer},
152
        legend:{show:true},
153
        axesDefaults:{
154
            renderer:$.jqplot.MekkoAxisRenderer
155
        },
156
        axes:{
157
            xaxis:{
158
                barLabels:barLabels,
159
                tickOptions:{formatString:'$%dM'}
160
            }
161
        }
162
    });
163
});
164
</script>
165
 
166
<script type="text/javascript" class="code">
167
$(document).ready(function(){
168
    var bar1 = [['shirts', 8],['hats', 14],['shoes', 6],['gloves', 16],['dolls', 12]];
169
    var bar2 = [15,6,9,13,6];
170
    var bar3 = [['grumpy',4],['sneezy',2],['happy',7],['sleepy',9],['doc',7]];
171
    var barLabels = ['Mickey Mouse', 'Donald Duck', 'Goofy'];
172
 
173
    var plot2 = $.jqplot('chart2', [bar1, bar2, bar3], {
174
        title: 'Revenue Breakdown per Character',
175
        seriesDefaults:{renderer:$.jqplot.MekkoRenderer, rendererOptions: {borderColor: '#dddddd'}},
176
        legend:{
177
            show:true,
178
            rendererOptions:{placement: "insideGrid"},
179
            location:'e'
180
        },
181
        axesDefaults:{
182
            renderer:$.jqplot.MekkoAxisRenderer,
183
            tickOptions:{}
184
        },
185
        axes:{
186
            xaxis:{
187
                barLabels:barLabels,
188
				rendererOptions: {
189
				    barLabelOptions: {
190
				      angle: -35
191
				    },
192
    				barLabelRenderer: $.jqplot.CanvasAxisLabelRenderer
193
				},
194
                max: 175,
195
                tickOptions:{formatString:'$%dM'}
196
            },
197
            x2axis:{
198
                show:true,
199
                tickMode:'even',
200
                max: 175,
201
                tickOptions:{formatString:'$%dM'}
202
            }
203
        }
204
    });
205
});
206
</script>
207
 
208
<script type="text/javascript" class="code">
209
$(document).ready(function(){
210
    var bar1 = [['shirts', 8],['hats', 14],['shoes', 6],['gloves', 16],['dolls', 12]];
211
    var bar2 = [15,6,9,13,6];
212
    var bar3 = [['grumpy',4],['sneezy',2],['happy',7],['sleepy',9],['doc',7]];
213
    var barLabels = ['Mickey Mouse', 'Donald Duck', 'Goofy'];
214
 
215
    var legendLabels = ['hotels', 'rides', 'buses', 'instruments', 'totes'];
216
 
217
    var plot3 = $.jqplot('chart3', [bar1, bar2, bar3], {
218
        title: 'Revenue Breakdown per Character',
219
        seriesDefaults:{renderer:$.jqplot.MekkoRenderer, rendererOptions: {showBorders: false}},
220
        legend:{
221
            show:true,
222
            location: 'n',
223
            labels: legendLabels,
224
            rendererOptions:{numberRows: 1, placement: "outside"}
225
        },
226
        axesDefaults:{
227
            renderer:$.jqplot.MekkoAxisRenderer,
228
            tickOptions:{showGridline:false}
229
        },
230
        axes:{
231
            xaxis:{
232
                tickMode:"bar",
233
                tickOptions:{formatString:'$%dM'}
234
            }
235
        }
236
    });
237
});
238
</script>
239
 
240
<!-- End example scripts -->
241
 
242
<!-- Don't touch this! -->
243
 
244
 
245
    <script class="include" type="text/javascript" src="../jquery.jqplot.min.js"></script>
246
    <script type="text/javascript" src="syntaxhighlighter/scripts/shCore.min.js"></script>
247
    <script type="text/javascript" src="syntaxhighlighter/scripts/shBrushJScript.min.js"></script>
248
    <script type="text/javascript" src="syntaxhighlighter/scripts/shBrushXml.min.js"></script>
249
<!-- End Don't touch this! -->
250
 
251
<!-- Additional plugins go here -->
252
 
253
  <script class="include" type="text/javascript" src="../plugins/jqplot.mekkoRenderer.min.js"></script>
254
  <script class="include" type="text/javascript" src="../plugins/jqplot.mekkoAxisRenderer.min.js"></script>
255
  <script class="include" type="text/javascript" src="../plugins/jqplot.canvasTextRenderer.min.js"></script>
256
  <script class="include" type="text/javascript" src="../plugins/jqplot.canvasAxisLabelRenderer.min.js"></script>
257
 
258
<!-- End additional plugins -->
259
 
260
        </div>
261
         <div class="col2">
262
 
263
           <div class="example-link"><a class="example-link" href="data-renderers.html">AJAX and JSON Data Loading via Data Renderers</a></div>
264
           <div class="example-link"><a class="example-link" href="barLineAnimated.html">Animated Charts</a></div>
265
           <div class="example-link"><a class="example-link" href="dashboardWidget.html">Animated Dashboard Sample - Filled Line with Log Axis</a></div>
266
           <div class="example-link"><a class="example-link" href="kcp_area.html">Area Chart</a></div>
267
           <div class="example-link"><a class="example-link" href="kcp_area2.html">Area Chart 2</a></div>
268
           <div class="example-link"><a class="example-link" href="axisLabelTests.html">Axis Labels</a></div>
269
           <div class="example-link"><a class="example-link" href="axisLabelsRotatedText.html">Axis Labels and Rotated Text</a></div>
270
           <div class="example-link"><a class="example-link" href="barTest.html">Bar Charts</a></div>
271
           <div class="example-link"><a class="example-link" href="multipleBarColors.html">Bar Colors Example</a></div>
272
           <div class="example-link"><a class="example-link" href="bezierCurve.html">Bezier Curve Plots</a></div>
273
           <div class="example-link"><a class="example-link" href="blockPlot.html">Block Plots</a></div>
274
           <div class="example-link"><a class="example-link" href="bubbleChart.html">Bubble Charts</a></div>
275
           <div class="example-link"><a class="example-link" href="bubble-plots.html">Bubble Plots</a></div>
276
           <div class="example-link"><a class="example-link" href="candlestick.html">Candlestick and Open Hi Low Close Charts</a></div>
277
           <div class="example-link"><a class="example-link" href="theming.html">Chart Theming</a></div>
278
           <div class="example-link"><a class="example-link" href="fillBetweenLines.html">Charts with Fill Between Lines</a></div>
279
           <div class="example-link"><a class="example-link" href="kcp_cdf.html">Cumulative Density Function Chart</a></div>
280
           <div class="example-link"><a class="example-link" href="dashedLines.html">Dashed Lines with Smoothing</a></div>
281
           <div class="example-link"><a class="example-link" href="cursor-highlighter.html">Data Point Highlighting, Tooltips and Cursor Tracking</a></div>
282
           <div class="example-link"><a class="example-link" href="point-labels.html">Data Point labels</a></div>
283
           <div class="example-link"><a class="example-link" href="date-axes.html">Date Axes</a></div>
284
           <div class="example-link"><a class="example-link" href="dateAxisRenderer.html">Date Axes 2</a></div>
285
           <div class="example-link"><a class="example-link" href="rotatedTickLabelsZoom.html">Date Axes, Rotated Labels and Zooming</a></div>
286
           <div class="example-link"><a class="example-link" href="canvas-overlay.html">Draw Lines on Plots - Canvas Overlay</a></div>
287
           <div class="example-link"><a class="example-link" href="draw-rectangles.html">Draw Rectangles on Plots</a></div>
288
           <div class="example-link"><a class="example-link" href="kcp_engel.html">Engel Curves</a></div>
289
           <div class="example-link"><a class="example-link" href="bandedLine.html">Error Bands and Confidence Intervals</a></div>
290
           <div class="example-link"><a class="example-link" href="area.html">Filled (Area) Charts</a></div>
291
           <div class="example-link"><a class="example-link" href="axisScalingForceTickAt.html">Force Plot to Have Tick at 0 or 100</a></div>
292
           <div class="example-link"><a class="example-link" href="hiddenPlotsInTabs.html">Hidden Plots</a></div>
293
           <div class="example-link"><a class="example-link" href="customHighlighterCursorTrendline.html">Highlighting, Dragging Points, Cursor and Trend Lines</a></div>
294
           <div class="example-link"><a class="example-link" href="line-charts.html">Line Charts and Options</a></div>
295
           <div class="example-link"><a class="example-link" href="kcp_lorenz.html">Lorenz Curves</a></div>
296
           <div class="example-link"><a class="example-link" href="mekkoCharts.html">Mekko Charts</a></div>
297
           <div class="example-link"><a class="example-link" href="meterGauge.html">Meter Gauge</a></div>
298
           <div class="example-link"><a class="example-link" href="candlestick-charts.html">Open Hi Low Close and Candlestick Charts</a></div>
299
           <div class="example-link"><a class="example-link" href="pieTest.html">Pie Charts and Options</a></div>
300
           <div class="example-link"><a class="example-link" href="pieTest4.html">Pie Charts and Options 2</a></div>
301
           <div class="example-link"><a class="example-link" href="pie-donut-charts.html">Pie and Donut Charts</a></div>
302
           <div class="example-link"><a class="example-link" href="selectorSyntax.html">Plot Creation with jQuery Selectors</a></div>
303
           <div class="example-link"><a class="example-link" href="zooming.html">Plot Zooming and Cursor Control</a></div>
304
           <div class="example-link"><a class="example-link" href="kcp_pdf.html">Probability Density Function Chart</a></div>
305
           <div class="example-link"><a class="example-link" href="kcp_pyramid_by_age.html">Pyramid Chart By Age</a></div>
306
           <div class="example-link"><a class="example-link" href="kcp_pyramid.html">Pyramid Charts</a></div>
307
           <div class="example-link"><a class="example-link" href="kcp_pyramid2.html">Pyramid Charts 2</a></div>
308
           <div class="example-link"><a class="example-link" href="kcp_quintiles.html">Quintile Pyramid Charts</a></div>
309
           <div class="example-link"><a class="example-link" href="resizablePlot.html">Resizable Plots</a></div>
310
           <div class="example-link"><a class="example-link" href="rotated-tick-labels.html">Rotated Labels and Font Styling</a></div>
311
           <div class="example-link"><a class="example-link" href="smoothedLine.html">Smoothed Lines</a></div>
312
           <div class="example-link"><a class="example-link" href="bar-charts.html">Vertical and Horizontal Bar Charts</a></div>
313
           <div class="example-link"><a class="example-link" href="waterfall.html">Waterfall Charts</a></div>
314
           <div class="example-link"><a class="example-link" href="waterfall2.html">Waterfall Charts 2</a></div>
315
           <div class="example-link"><a class="example-link" href="zoomOptions.html">Zoom Options</a></div>
316
           <div class="example-link"><a class="example-link" href="zoomProxy.html">Zoom Proxy - Control one plot from another</a></div>
317
           <div class="example-link"><a class="example-link" href="zoom1.html">Zooming</a></div>
318
           <div class="example-link"><a class="example-link" href="dateAxisLogAxisZooming.html">Zooming with Date and Log Axes</a></div>
319
 
320
         </div>
321
               </div>
322
    </div>
323
    <script type="text/javascript" src="example.min.js"></script>
324
 
325
</body>
326
 
327
 
328
</html>