kcp_area2.html 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>Area Chart 2</title>
  5. <link class="include" rel="stylesheet" type="text/css" href="../jquery.jqplot.min.css" />
  6. <link rel="stylesheet" type="text/css" href="examples.min.css" />
  7. <link type="text/css" rel="stylesheet" href="syntaxhighlighter/styles/shCoreDefault.min.css" />
  8. <link type="text/css" rel="stylesheet" href="syntaxhighlighter/styles/shThemejqPlot.min.css" />
  9. <!--[if lt IE 9]><script language="javascript" type="text/javascript" src="../excanvas.js"></script><![endif]-->
  10. <script class="include" type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
  11. </head>
  12. <body>
  13. <div id="header">
  14. <div class="nav">
  15. <a class="nav" href="../../../index.php"><span>&gt;</span>Home</a>
  16. <a class="nav" href="../../../docs/"><span>&gt;</span>Docs</a>
  17. <a class="nav" href="../../download/"><span>&gt;</span>Download</a>
  18. <a class="nav" href="../../../info.php"><span>&gt;</span>Info</a>
  19. <a class="nav" href="../../../donate.php"><span>&gt;</span>Donate</a>
  20. </div>
  21. </div>
  22. <div class="colmask leftmenu">
  23. <div class="colleft">
  24. <div class="col1" id="example-content">
  25. <!-- Example scripts go here -->
  26. <link class="include" type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.0/themes/smoothness/jquery-ui.css" rel="Stylesheet" />
  27. <style type="text/css">
  28. .chart-container {
  29. border: 1px solid darkblue;
  30. padding: 30px 0px 30px 30px;
  31. width: 900px;
  32. height: 400px;
  33. }
  34. table.jqplot-table-legend {
  35. border: 0px;
  36. }
  37. td.jqplot-table-legend-label {
  38. padding: 0.25em;
  39. }
  40. td.jqplot-table-legend-label + td.jqplot-table-legend-swatch {
  41. padding-left: 1.5em;
  42. }
  43. div.jqplot-table-legend-swatch {
  44. border-width: 4px 6px;
  45. }
  46. div.jqplot-table-legend-swatch-outline {
  47. border: none;
  48. }
  49. #chart1 {
  50. width: 96%;
  51. height: 96%;
  52. }
  53. .jqplot-datestamp {
  54. font-size: 0.8em;
  55. color: #777;
  56. /* margin-top: 1em;
  57. text-align: right;*/
  58. font-style: italic;
  59. position: absolute;
  60. bottom: 15px;
  61. right: 15px;
  62. }
  63. td.controls li {
  64. list-style-type: none;
  65. }
  66. td.controls ul {
  67. margin-top: 0.5em;
  68. padding-left: 0.2em;
  69. }
  70. pre.code {
  71. margin-top: 45px;
  72. clear: both;
  73. }
  74. </style>
  75. <div class="chart-container">
  76. <div id="chart1"></div>
  77. <div class="jqplot-datestamp"></div>
  78. </div>
  79. <pre class="code brush:js"></pre>
  80. <script class="common" type="text/javascript">
  81. var data = {
  82. "rural": [0.9176, 0.9296, 0.927, 0.9251, 0.9241, 0.9225, 0.9197, 0.9164, 0.9131, 0.9098, 0.9064, 0.9028, 0.8991, 0.8957, 0.8925, 0.8896, 0.8869, 0.8844, 0.882, 0.8797, 0.8776, 0.8755, 0.8735, 0.8715, 0.8696, 0.8677, 0.8658, 0.8637, 0.8616, 0.8594, 0.8572, 0.8548, 0.8524, 0.8499, 0.8473, 0.8446, 0.8418, 0.8389, 0.8359, 0.8328, 0.8295, 0.8262, 0.8227, 0.8191, 0.8155, 0.8119, 0.8083, 0.8048, 0.8013, 0.7979, 0.7945, 0.7912, 0.7879, 0.7846, 0.7813, 0.778, 0.7747, 0.7714, 0.768, 0.7647, 0.7612, 0.7577, 0.7538, 0.7496, 0.7449, 0.7398, 0.7342, 0.7279, 0.721, 0.7137, 0.7059, 0.6977, 0.6889, 0.6797, 0.6698, 0.6593, 0.6482, 0.6367, 0.6247, 0.6121, 0.5989, 0.5852, 0.571, 0.5561, 0.5402, 0.5232, 0.505, 0.4855, 0.4643, 0.4414, 0.4166, 0.3893, 0.3577, 0.3204, 0.2764, 0.2272, 0.1774, 0.1231, 0.0855, 0.0849],
  83. "urban": [0.0824, 0.0704, 0.073, 0.0749, 0.0759, 0.0775, 0.0803, 0.0836, 0.0869, 0.0902, 0.0936, 0.0972, 0.1009, 0.1043, 0.1075, 0.1104, 0.1131, 0.1156, 0.118, 0.1203, 0.1224, 0.1245, 0.1265, 0.1285, 0.1304, 0.1323, 0.1342, 0.1363, 0.1384, 0.1406, 0.1428, 0.1452, 0.1476, 0.1501, 0.1527, 0.1554, 0.1582, 0.1611, 0.1641, 0.1672, 0.1705, 0.1738, 0.1773, 0.1809, 0.1845, 0.1881, 0.1917, 0.1952, 0.1987, 0.2021, 0.2055, 0.2088, 0.2121, 0.2154, 0.2187, 0.222, 0.2253, 0.2286, 0.232, 0.2353, 0.2388, 0.2423, 0.2462, 0.2504, 0.2551, 0.2602, 0.2658, 0.2721, 0.279, 0.2863, 0.2941, 0.3023, 0.3111, 0.3203, 0.3302, 0.3407, 0.3518, 0.3633, 0.3753, 0.3879, 0.4011, 0.4148, 0.429, 0.4439, 0.4598, 0.4768, 0.495, 0.5145, 0.5357, 0.5586, 0.5834, 0.6107, 0.6423, 0.6796, 0.7236, 0.7728, 0.8226, 0.8769, 0.9145, 0.9151]
  84. };
  85. </script>
  86. <script class="code" type="text/javascript">
  87. $(document).ready(function(){
  88. var labels = ['Rural', 'Urban'];
  89. // make the plot
  90. plot1 = $.jqplot('chart1', [data.rural, data.urban], {
  91. title: 'Contribution of Urban and Rural Population to National Percentiles (edited data)',
  92. stackSeries: true,
  93. seriesColors: ['#77933C', '#B9CDE5'],
  94. seriesDefaults: {
  95. showMarker: false,
  96. fill: true,
  97. fillAndStroke: true
  98. },
  99. legend: {
  100. show: true,
  101. renderer: $.jqplot.EnhancedLegendRenderer,
  102. rendererOptions: {
  103. numberRows: 1
  104. },
  105. placement: 'outsideGrid',
  106. labels: labels,
  107. location: 's'
  108. },
  109. axes: {
  110. xaxis: {
  111. pad: 0,
  112. min: 1,
  113. max: 100,
  114. label: 'Population Percentile',
  115. labelRenderer: $.jqplot.CanvasAxisLabelRenderer,
  116. tickInterval: 3,
  117. tickOptions: {
  118. showGridline: false
  119. }
  120. },
  121. yaxis: {
  122. min: 0,
  123. max: 1,
  124. label: 'Percentage of Population',
  125. labelRenderer: $.jqplot.CanvasAxisLabelRenderer,
  126. tickOptions: {
  127. formatter: $.jqplot.PercentTickFormatter,
  128. showGridline: false,
  129. formatString: '%d%%'
  130. }
  131. }
  132. },
  133. grid: {
  134. drawBorder: false,
  135. shadow: false,
  136. // background: 'rgba(0,0,0,0)' works to make transparent.
  137. background: 'white'
  138. }
  139. });
  140. // data is in json format in plain file.
  141. // Each series is represented by a 1-D array of y values.
  142. // X values will be added by jqPlot and will start 1 by default.
  143. //$.getJSON('kcp_area2.json', '', makePlot);
  144. // add a date at the bottom.
  145. var d = new $.jsDate();
  146. $('div.jqplot-datestamp').html('Generated on '+d.strftime('%v'));
  147. // make it resizable.
  148. $("div.chart-container").resizable({delay:20});
  149. $('div.chart-container').bind('resize', function(event, ui) {
  150. plot1.replot();
  151. });
  152. });
  153. </script>
  154. <!-- End example scripts -->
  155. <!-- Don't touch this! -->
  156. <script class="include" type="text/javascript" src="../jquery.jqplot.min.js"></script>
  157. <script type="text/javascript" src="syntaxhighlighter/scripts/shCore.min.js"></script>
  158. <script type="text/javascript" src="syntaxhighlighter/scripts/shBrushJScript.min.js"></script>
  159. <script type="text/javascript" src="syntaxhighlighter/scripts/shBrushXml.min.js"></script>
  160. <!-- End Don't touch this! -->
  161. <!-- Additional plugins go here -->
  162. <script class="include" type="text/javascript" src="../plugins/jqplot.enhancedLegendRenderer.min.js"></script>
  163. <script class="include" type="text/javascript" src="../plugins/jqplot.canvasTextRenderer.min.js"></script>
  164. <script class="include" type="text/javascript" src="../plugins/jqplot.canvasAxisLabelRenderer.min.js"></script>
  165. <script class="include" type="text/javascript" src="jquery-ui/js/jquery-ui.min.js"></script>
  166. <!-- End additional plugins -->
  167. </div>
  168. <div class="col2">
  169. <div class="example-link"><a class="example-link" href="data-renderers.html">AJAX and JSON Data Loading via Data Renderers</a></div>
  170. <div class="example-link"><a class="example-link" href="barLineAnimated.html">Animated Charts</a></div>
  171. <div class="example-link"><a class="example-link" href="dashboardWidget.html">Animated Dashboard Sample - Filled Line with Log Axis</a></div>
  172. <div class="example-link"><a class="example-link" href="kcp_area.html">Area Chart</a></div>
  173. <div class="example-link"><a class="example-link" href="kcp_area2.html">Area Chart 2</a></div>
  174. <div class="example-link"><a class="example-link" href="axisLabelTests.html">Axis Labels</a></div>
  175. <div class="example-link"><a class="example-link" href="axisLabelsRotatedText.html">Axis Labels and Rotated Text</a></div>
  176. <div class="example-link"><a class="example-link" href="barTest.html">Bar Charts</a></div>
  177. <div class="example-link"><a class="example-link" href="multipleBarColors.html">Bar Colors Example</a></div>
  178. <div class="example-link"><a class="example-link" href="bezierCurve.html">Bezier Curve Plots</a></div>
  179. <div class="example-link"><a class="example-link" href="blockPlot.html">Block Plots</a></div>
  180. <div class="example-link"><a class="example-link" href="bubbleChart.html">Bubble Charts</a></div>
  181. <div class="example-link"><a class="example-link" href="bubble-plots.html">Bubble Plots</a></div>
  182. <div class="example-link"><a class="example-link" href="candlestick.html">Candlestick and Open Hi Low Close Charts</a></div>
  183. <div class="example-link"><a class="example-link" href="theming.html">Chart Theming</a></div>
  184. <div class="example-link"><a class="example-link" href="fillBetweenLines.html">Charts with Fill Between Lines</a></div>
  185. <div class="example-link"><a class="example-link" href="kcp_cdf.html">Cumulative Density Function Chart</a></div>
  186. <div class="example-link"><a class="example-link" href="dashedLines.html">Dashed Lines with Smoothing</a></div>
  187. <div class="example-link"><a class="example-link" href="cursor-highlighter.html">Data Point Highlighting, Tooltips and Cursor Tracking</a></div>
  188. <div class="example-link"><a class="example-link" href="point-labels.html">Data Point labels</a></div>
  189. <div class="example-link"><a class="example-link" href="date-axes.html">Date Axes</a></div>
  190. <div class="example-link"><a class="example-link" href="dateAxisRenderer.html">Date Axes 2</a></div>
  191. <div class="example-link"><a class="example-link" href="rotatedTickLabelsZoom.html">Date Axes, Rotated Labels and Zooming</a></div>
  192. <div class="example-link"><a class="example-link" href="canvas-overlay.html">Draw Lines on Plots - Canvas Overlay</a></div>
  193. <div class="example-link"><a class="example-link" href="draw-rectangles.html">Draw Rectangles on Plots</a></div>
  194. <div class="example-link"><a class="example-link" href="kcp_engel.html">Engel Curves</a></div>
  195. <div class="example-link"><a class="example-link" href="bandedLine.html">Error Bands and Confidence Intervals</a></div>
  196. <div class="example-link"><a class="example-link" href="area.html">Filled (Area) Charts</a></div>
  197. <div class="example-link"><a class="example-link" href="axisScalingForceTickAt.html">Force Plot to Have Tick at 0 or 100</a></div>
  198. <div class="example-link"><a class="example-link" href="hiddenPlotsInTabs.html">Hidden Plots</a></div>
  199. <div class="example-link"><a class="example-link" href="customHighlighterCursorTrendline.html">Highlighting, Dragging Points, Cursor and Trend Lines</a></div>
  200. <div class="example-link"><a class="example-link" href="line-charts.html">Line Charts and Options</a></div>
  201. <div class="example-link"><a class="example-link" href="kcp_lorenz.html">Lorenz Curves</a></div>
  202. <div class="example-link"><a class="example-link" href="mekkoCharts.html">Mekko Charts</a></div>
  203. <div class="example-link"><a class="example-link" href="meterGauge.html">Meter Gauge</a></div>
  204. <div class="example-link"><a class="example-link" href="candlestick-charts.html">Open Hi Low Close and Candlestick Charts</a></div>
  205. <div class="example-link"><a class="example-link" href="pieTest.html">Pie Charts and Options</a></div>
  206. <div class="example-link"><a class="example-link" href="pieTest4.html">Pie Charts and Options 2</a></div>
  207. <div class="example-link"><a class="example-link" href="pie-donut-charts.html">Pie and Donut Charts</a></div>
  208. <div class="example-link"><a class="example-link" href="selectorSyntax.html">Plot Creation with jQuery Selectors</a></div>
  209. <div class="example-link"><a class="example-link" href="zooming.html">Plot Zooming and Cursor Control</a></div>
  210. <div class="example-link"><a class="example-link" href="kcp_pdf.html">Probability Density Function Chart</a></div>
  211. <div class="example-link"><a class="example-link" href="kcp_pyramid_by_age.html">Pyramid Chart By Age</a></div>
  212. <div class="example-link"><a class="example-link" href="kcp_pyramid.html">Pyramid Charts</a></div>
  213. <div class="example-link"><a class="example-link" href="kcp_pyramid2.html">Pyramid Charts 2</a></div>
  214. <div class="example-link"><a class="example-link" href="kcp_quintiles.html">Quintile Pyramid Charts</a></div>
  215. <div class="example-link"><a class="example-link" href="resizablePlot.html">Resizable Plots</a></div>
  216. <div class="example-link"><a class="example-link" href="rotated-tick-labels.html">Rotated Labels and Font Styling</a></div>
  217. <div class="example-link"><a class="example-link" href="smoothedLine.html">Smoothed Lines</a></div>
  218. <div class="example-link"><a class="example-link" href="bar-charts.html">Vertical and Horizontal Bar Charts</a></div>
  219. <div class="example-link"><a class="example-link" href="waterfall.html">Waterfall Charts</a></div>
  220. <div class="example-link"><a class="example-link" href="waterfall2.html">Waterfall Charts 2</a></div>
  221. <div class="example-link"><a class="example-link" href="zoomOptions.html">Zoom Options</a></div>
  222. <div class="example-link"><a class="example-link" href="zoomProxy.html">Zoom Proxy - Control one plot from another</a></div>
  223. <div class="example-link"><a class="example-link" href="zoom1.html">Zooming</a></div>
  224. <div class="example-link"><a class="example-link" href="dateAxisLogAxisZooming.html">Zooming with Date and Log Axes</a></div>
  225. </div>
  226. </div>
  227. </div>
  228. <script type="text/javascript" src="example.min.js"></script>
  229. </body>
  230. </html>