6 <title>Area Chart
2</title>
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" />
13 <!--[if lt IE 9]><script language="javascript" type="text/javascript" src="../excanvas.js"></script><![endif]-->
14 <script class="include" type="text/javascript" src="../jquery.min.js"></script>
21 <a class="nav" href="../../../index.php"><span>></span>Home</a>
22 <a class="nav" href="../../../docs/"><span>></span>Docs</a>
23 <a class="nav" href="../../download/"><span>></span>Download</a>
24 <a class="nav" href="../../../info.php"><span>></span>Info</a>
25 <a class="nav" href="../../../donate.php"><span>></span>Donate</a>
28 <div class="example-content">
30 <div class="example-nav">
31 <a href="kcp_area.html">Previous</a> <a href="./">Examples</a> <a href="kcp_cdf.html">Next</a></div>
34 <!-- Example scripts go here -->
37 <link class="include" type="text/css" href="jquery-ui/css/smoothness/jquery-ui.min.css" rel="Stylesheet" />
39 <style type="text/css">
42 border: 1px solid darkblue;
43 padding: 30px 0px 30px 30px;
49 table.jqplot-table-legend {
53 td.jqplot-table-legend-label {
57 td.jqplot-table-legend-label + td.jqplot-table-legend-swatch {
61 div.jqplot-table-legend-swatch {
62 border-width: 4px 6px;
65 div.jqplot-table-legend-swatch-outline {
86 list-style-type: none;
101 <div class="chart-container">
102 <div id="chart1"></div>
103 <div class="jqplot-datestamp"></div>
106 <pre class="code brush:js"></pre>
108 <script class="code" type="text/javascript">
109 $(document).ready(function(){
111 var labels = ['Rural', 'Urban'];
115 var makePlot = function (data, textStatus, jqXHR) {
116 plot1 = $.jqplot('chart1', [data.rural, data.urban], {
117 title: 'Contribution of Urban and Rural Population to National Percentiles (edited data)',
119 seriesColors: ['#77933C', '#B9CDE5'],
127 renderer: $.jqplot.EnhancedLegendRenderer,
131 placement: 'outsideGrid',
140 label: 'Population Percentile',
141 labelRenderer: $.jqplot.CanvasAxisLabelRenderer,
150 label: 'Percentage of Population',
151 labelRenderer: $.jqplot.CanvasAxisLabelRenderer,
153 formatter: $.jqplot.PercentTickFormatter,
162 // background: 'rgba(0,0,0,0)' works to make transparent.
168 // data is in json format in plain file.
169 // Each series is represented by a 1-D array of y values.
170 // X values will be added by jqPlot and will start 1 by default.
171 $.getJSON('kcp_area2.json', '', makePlot);
173 // add a date at the bottom.
175 var d = new $.jsDate();
176 $('div.jqplot-datestamp').html('Generated on '+d.strftime('%v'));
178 // make it resizable.
180 $("div.chart-container").resizable({delay:20});
182 $('div.chart-container').bind('resize', function(event, ui) {
190 <!-- End example scripts -->
192 <!-- Don't touch this! -->
195 <script class="include" type="text/javascript" src="../jquery.jqplot.min.js"></script>
196 <script type="text/javascript" src="syntaxhighlighter/scripts/shCore.min.js"></script>
197 <script type="text/javascript" src="syntaxhighlighter/scripts/shBrushJScript.min.js"></script>
198 <script type="text/javascript" src="syntaxhighlighter/scripts/shBrushXml.min.js"></script>
199 <!-- End Don't touch this! -->
201 <!-- Additional plugins go here -->
203 <script class="include" type="text/javascript" src="../plugins/jqplot.enhancedLegendRenderer.min.js"></script>
204 <script class="include" type="text/javascript" src="../plugins/jqplot.canvasTextRenderer.min.js"></script>
205 <script class="include" type="text/javascript" src="../plugins/jqplot.canvasAxisLabelRenderer.min.js"></script>
206 <script class="include" type="text/javascript" src="jquery-ui/js/jquery-ui.min.js"></script>
208 <!-- End additional plugins -->
212 <script type="text/javascript" src="example.min.js"></script>