2 $title = "Mekko Charts";
3 // $plotTargets = array (array('id'=>'chart1', 'width'=>700, 'height'=>400));
5 <?php include "opener.php"; ?>
7 <!-- Example scripts go here -->
8 <style type="text/css" media="screen">
11 font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
25 background-color: #efead9;
32 .jqplot-mekko-barLabel {
36 #chart2 .jqplot-axis {
40 #chart3 .jqplot-title {
44 <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>
46 bar1 = [['shirts', 8],['hats', 14],['shoes', 6],['gloves', 16],['dolls', 12]];
48 bar3 = [['grumpy',4],['sneezy',2],['happy',7],['sleepy',9],['doc',7]];
51 <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>
53 barLabels = ['Mickey Mouse', 'Donald Duck', 'Goofy'];
54 axes:{xaxis:{barLabels:barLabels}}
57 <div id="chart1" style="width:500px; height:300px;"></div>
59 <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>
75 <p>Here the borders between chart areas have been given a custom color using the "borderColor" option on the series renderer.</p>
78 seriesDefaults:{renderer:$.jqplot.MekkoRenderer, rendererOptions: {borderColor: '#dddddd'}}
81 <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>
86 rendererOptions:{placement: "insideGrid"},
91 <div id="chart2" style="width:500px; height:300px;"></div>
93 <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>
95 <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>
98 legendLabels = ['hotels', 'rides', 'buses', 'instruments', 'totes'];
103 labels: legendLabels,
104 rendererOptions:{numberRows: 1, placement: "outside"}
108 <p>Also, the borders between the chart areas have been turned off with the "showBorders: false" option.</p>
111 seriesDefaults:{renderer:$.jqplot.MekkoRenderer, rendererOptions: {showBorders: false}}
114 <div id="chart3" style="width:500px; height:300px;"></div>
116 <script type="text/javascript" class="code">
117 $(document).ready(function(){
118 var bar1 = [['shirts', 8],['hats', 14],['shoes', 6],['gloves', 16],['dolls', 12]];
119 var bar2 = [15,6,9,13,6];
120 var bar3 = [['grumpy',4],['sneezy',2],['happy',7],['sleepy',9],['doc',7]];
121 var barLabels = ['Mickey Mouse', 'Donald Duck', 'Goofy'];
123 plot1 = $.jqplot('chart1', [bar1, bar2, bar3], {
124 title: 'Revenue Breakdown per Character',
125 seriesDefaults:{renderer:$.jqplot.MekkoRenderer},
128 renderer:$.jqplot.MekkoAxisRenderer
133 tickOptions:{formatString:'$%dM'}
140 <script type="text/javascript" class="code">
141 $(document).ready(function(){
142 var bar1 = [['shirts', 8],['hats', 14],['shoes', 6],['gloves', 16],['dolls', 12]];
143 var bar2 = [15,6,9,13,6];
144 var bar3 = [['grumpy',4],['sneezy',2],['happy',7],['sleepy',9],['doc',7]];
145 var barLabels = ['Mickey Mouse', 'Donald Duck', 'Goofy'];
147 var plot2 = $.jqplot('chart2', [bar1, bar2, bar3], {
148 title: 'Revenue Breakdown per Character',
149 seriesDefaults:{renderer:$.jqplot.MekkoRenderer, rendererOptions: {borderColor: '#dddddd'}},
152 rendererOptions:{placement: "insideGrid"},
156 renderer:$.jqplot.MekkoAxisRenderer,
166 barLabelRenderer: $.jqplot.CanvasAxisLabelRenderer
169 tickOptions:{formatString:'$%dM'}
175 tickOptions:{formatString:'$%dM'}
182 <script type="text/javascript" class="code">
183 $(document).ready(function(){
184 var bar1 = [['shirts', 8],['hats', 14],['shoes', 6],['gloves', 16],['dolls', 12]];
185 var bar2 = [15,6,9,13,6];
186 var bar3 = [['grumpy',4],['sneezy',2],['happy',7],['sleepy',9],['doc',7]];
187 var barLabels = ['Mickey Mouse', 'Donald Duck', 'Goofy'];
189 var legendLabels = ['hotels', 'rides', 'buses', 'instruments', 'totes'];
191 var plot3 = $.jqplot('chart3', [bar1, bar2, bar3], {
192 title: 'Revenue Breakdown per Character',
193 seriesDefaults:{renderer:$.jqplot.MekkoRenderer, rendererOptions: {showBorders: false}},
197 labels: legendLabels,
198 rendererOptions:{numberRows: 1, placement: "outside"}
201 renderer:$.jqplot.MekkoAxisRenderer,
202 tickOptions:{showGridline:false}
207 tickOptions:{formatString:'$%dM'}
214 <!-- End example scripts -->
216 <!-- Don't touch this! -->
218 <?php include "commonScripts.html" ?>
220 <!-- End Don't touch this! -->
222 <!-- Additional plugins go here -->
224 <script class="include" type="text/javascript" src="../src/jquery.jqplot.js"></script>
225 <script class="include" type="text/javascript" src="../src/plugins/jqplot.mekkoRenderer.js"></script>
226 <script class="include" type="text/javascript" src="../src/plugins/jqplot.mekkoAxisRenderer.js"></script>
227 <script class="include" type="text/javascript" src="../src/plugins/jqplot.canvasTextRenderer.js"></script>
228 <script class="include" type="text/javascript" src="../src/plugins/jqplot.canvasAxisLabelRenderer.js"></script>
230 <!-- End additional plugins -->
232 <?php include "closer.html"; ?>