kcp_engel.html 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>Engel Curves</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. font-size: 0.65em;
  36. line-height: 1em;
  37. margin: 0px 0px 10px 15px;
  38. }
  39. td.jqplot-table-legend-label {
  40. width: 20em;
  41. }
  42. div.jqplot-table-legend-swatch {
  43. border-width: 1.5px 6px;
  44. }
  45. div.jqplot-table-legend-swatch-outline {
  46. border: none;
  47. }
  48. #chart1 {
  49. width: 96%;
  50. height: 96%;
  51. }
  52. .jqplot-datestamp {
  53. font-size: 0.8em;
  54. color: #777;
  55. /* margin-top: 1em;
  56. text-align: right;*/
  57. font-style: italic;
  58. position: absolute;
  59. bottom: 15px;
  60. right: 15px;
  61. }
  62. td.controls li {
  63. list-style-type: none;
  64. }
  65. td.controls ul {
  66. margin-top: 0.5em;
  67. padding-left: 0.2em;
  68. }
  69. pre.code {
  70. margin-top: 45px;
  71. clear: both;
  72. }
  73. </style>
  74. <div class="chart-container">
  75. <div id="chart1"></div>
  76. <div class="jqplot-datestamp"></div>
  77. </div>
  78. <pre class="code brush:js"></pre>
  79. <script class="code" type="text/javascript">
  80. $(document).ready(function(){
  81. var data = [
  82. [15.8442,13.0993,11.2898,10.7892,10.252,9.0165,8.5287,7.7442,6.9867,6.5213,5.9473,5.4766,4.9214,4.6398,3.8935,3.5228,3.0128,2.4847,2.0357,1.0672],
  83. [1.7703,2.2535,2.2753,2.7927,2.2509,2.4341,2.5518,2.5547,2.4204,2.4186,2.4261,2.2927,2.4386,2.2295,2.2203,1.915,1.8791,1.7941,1.6567,0.9296],
  84. [8.3728,8.1221,8.3989,7.9758,8.8246,8.2377,8.432,7.8466,7.5343,7.1171,6.9801,6.9349,5.8307,5.7089,4.927,4.2237,3.6872,3.1429,2.581,1.3766],
  85. [9.1249,8.7326,7.6122,7.8577,7.1625,6.8527,6.5158,6.1715,6.1298,5.8702,5.3456,4.9906,4.4424,4.3022,3.5298,3.405,2.9977,2.4159,2.0832,1.1499],
  86. [8.0508,7.7875,7.6534,7.4448,7.3702,7.4188,7.3882,7.1647,6.9617,6.6576,6.6077,6.4823,5.9117,5.8149,5.505,5.5355,5.0907,4.569,4.3049,2.6325],
  87. [10.4408,9.8278,9.9293,9.5176,9.6658,9.2359,9.2842,8.6497,8.7656,8.2962,8.155,7.7294,7.3674,6.9888,6.2995,5.7314,5.2703,4.6947,3.9614,2.2509],
  88. [4.1883,4.7514,5.3198,5.8819,5.1732,5.5764,6.1713,6.7915,6.8511,7.2681,7.1461,8.109,9.2649,9.5322,11.2138,12.8299,12.9621,13.8936,13.7828,10.0525],
  89. [0.6641,0.8454,0.9018,1.0461,1.0113,1.235,1.279,1.3049,1.5024,1.4471,1.5358,1.5796,1.6471,1.6443,1.6562,1.6763,1.6097,1.5039,1.3752,0.864],
  90. [0.5221,0.6997,0.8513,0.8849,0.9168,0.9099,0.8339,0.9921,1.1169,1.1764,1.1936,1.1415,1.1181,1.2889,1.1378,1.023,1.1283,1.0417,0.9839,0.587],
  91. [1.0969,1.188,1.0713,1.2803,1.1787,1.148,1.3229,1.1726,1.3764,1.3887,1.4011,1.3034,1.4368,1.5017,1.4899,1.4123,1.3168,1.1407,0.8458,0.38],
  92. [2.275,2.5511,3.1025,2.9834,3.2857,3.7625,3.1928,3.7071,4.0364,3.629,3.9258,3.2208,3.7113,3.3166,3.4775,3.429,3.6121,3.4569,3.8416,4.1323],
  93. [16.0654,15.719,16.3773,16.0175,15.8853,16.132,16.1309,16.3491,15.8512,16.4743,16.2862,15.7327,16.2793,16.6329,17.4903,17.4425,17.3413,18.3527,18.5029,15.2763],
  94. [1.1145,1.176,1.1183,1.0411,1.0058,1.0796,1.0321,1.0714,1.1117,1.0278,1.136,1.1397,1.1556,1.2206,1.2871,1.2361,1.2111,1.2312,1.1545,0.7881],
  95. [4.5928,4.7558,4.8855,4.4684,4.6677,4.6038,4.7789,4.6098,4.4171,4.5078,4.4137,4.4645,4.2693,4.2836,4.1709,4.159,3.8423,3.9957,3.6816,2.5785],
  96. [2.1027,2.1576,2.0721,2.0623,2.3498,2.2573,2.2866,2.3766,2.2488,2.3665,2.3445,2.2474,2.3345,2.2479,2.158,2.355,2.0744,2.2269,3.0474,3.8925],
  97. [1.2709,1.6007,1.3996,1.612,1.4649,1.5875,1.7056,1.7315,1.7378,2.0401,2.3265,2.1096,2.0513,2.1548,2.0634,2.2206,1.8427,2.4817,2.3066,2.1685],
  98. [4.6414,5.6167,5.9571,6.5372,7.0242,7.6332,7.9823,8.3906,9.112,9.6872,10.2014,11.0074,11.375,11.6753,12.0489,12.0692,13.2962,13.2183,14.6559,32.0912],
  99. [0.2334,0.3642,0.5267,0.5911,0.8888,1.1633,1.0997,1.76,1.9811,2.1708,2.931,3.2634,3.6254,4.107,4.6944,5.0941,5.9984,6.2419,6.6059,5.8353],
  100. [2.2553,2.8903,2.9564,3.2839,3.4822,3.255,3.1666,3.4245,3.4066,3.8536,3.6333,4.0331,4.4847,4.3552,4.2768,4.1439,4.7196,4.6585,4.4286,3.921],
  101. [0.3437,0.3282,0.4805,0.3881,0.4796,0.9766,0.6589,0.6443,1.0423,0.7941,1.064,1.5504,1.3977,1.5226,1.8344,1.9186,2.3022,2.8188,2.8424,2.7792],
  102. [3.4466,3.5641,3.5711,3.4219,3.2835,3.3569,3.3416,3.4544,3.3675,3.2806,3.118,3.1881,3.2252,3.0588,3.0051,2.9868,3.0361,2.8972,2.9611,2.2867],
  103. [1.5831,1.9691,2.2498,2.122,2.3766,2.1273,2.3165,2.0884,2.0421,2.0067,1.8809,2.0027,1.7115,1.7734,1.6204,1.6702,1.769,1.7391,2.3607,2.9604],
  104. [58.4561,55.4196,53.3806,53.3059,51.7105,50.007,50.1509,48.2276,47.1521,45.5962,44.1436,43.5952,41.8242,40.8606,39.2451,38.8396,36.5095,34.4988,31.7809,20.3231],
  105. [41.5439,44.5804,46.6194,46.6941,48.2895,49.993,49.8491,51.7724,52.8479,54.4038,55.8564,56.4048,58.1758,59.1394,60.7549,61.1604,63.4905,65.5012,68.2191,79.6769]
  106. ];
  107. var labels = ["Rice", "Bread and other cereals", "Fish and seafood", "Fruits and vegetables", "Other food products",
  108. "Catering services", "Non-alcoholic beverages", "Alcoholic beverages", "Tobacco and narcotics", "Clothing and footwear",
  109. "Rentals (actual or imputed) and maintenance and repair of the dwelling", "Water supply and miscellaneous services related to the dwelling",
  110. "Electricity gas and other fuels", "Furnishing household equipment and routine household maintenance", "Health", "Transport",
  111. "Communication", "Recreation and culture", "Education", "Personal care", "Other miscellaneous goods and services",
  112. "Food and non-alcoholic beverages", "Non food"]
  113. var ticks = [[1, "v01"], [2, "v02"], [3, "v03"], [4, "v04"], [5, "v05"],
  114. [6, "v06"], [7, "v07"], [8, "v08"], [9, "v09"], [10, "v10"],
  115. [11, "v11"], [12, "v12"], [13, "v13"], [14, "v14"], [15, "v15"],
  116. [16, "v16"], [17, "v17"], [18, "v18"], [19, "v19"], [20, "v20"]];
  117. // make the plot
  118. plot1 = $.jqplot("chart1", data, {
  119. title: "Engel Curves",
  120. animate: true,
  121. axesDefaults: {
  122. labelRenderer: $.jqplot.CanvasAxisLabelRenderer
  123. },
  124. seriesDefaults: {
  125. showMarker: false
  126. },
  127. legend: {
  128. show: true,
  129. renderer: $.jqplot.EnhancedLegendRenderer,
  130. placement: "outsideGrid",
  131. labels: labels,
  132. location: "ne",
  133. rowSpacing: "0px",
  134. rendererOptions: {
  135. // set to true to replot when toggling series on/off
  136. // set to an options object to pass in replot options.
  137. seriesToggle: 'normal',
  138. seriesToggleReplot: {resetAxes: true}
  139. }
  140. },
  141. axes: {
  142. xaxis: {
  143. label: 'Population Percentile',
  144. pad: 1.01,
  145. tickOptions: {
  146. showGridline: false
  147. }
  148. },
  149. yaxis: {
  150. label: 'Share in Total Expenditure (%)',
  151. tickOptions: {
  152. suffix: '%'
  153. },
  154. padMin: 0,
  155. padMax: 1.05
  156. }
  157. },
  158. grid: {
  159. drawBorder: false,
  160. shadow: false,
  161. // background: 'rgba(0,0,0,0)' works to make transparent.
  162. background: "white"
  163. }
  164. });
  165. // add a date at the bottom.
  166. var d = new $.jsDate();
  167. $("div.jqplot-datestamp").html("Generated on "+d.strftime("%v"));
  168. // make it resizable.
  169. $("div.chart-container").resizable({delay:20});
  170. $("div.chart-container").bind("resize", function(event, ui) {
  171. plot1.replot();
  172. });
  173. });
  174. </script>
  175. <!-- End example scripts -->
  176. <!-- Don't touch this! -->
  177. <script class="include" type="text/javascript" src="../jquery.jqplot.min.js"></script>
  178. <script type="text/javascript" src="syntaxhighlighter/scripts/shCore.min.js"></script>
  179. <script type="text/javascript" src="syntaxhighlighter/scripts/shBrushJScript.min.js"></script>
  180. <script type="text/javascript" src="syntaxhighlighter/scripts/shBrushXml.min.js"></script>
  181. <!-- End Don't touch this! -->
  182. <!-- Additional plugins go here -->>
  183. <script class="include" type="text/javascript" src="../plugins/jqplot.canvasTextRenderer.min.js"></script>
  184. <script class="include" type="text/javascript" src="../plugins/jqplot.canvasAxisLabelRenderer.min.js"></script>
  185. <script class="include" type="text/javascript" src="../plugins/jqplot.enhancedLegendRenderer.min.js"></script>
  186. <script class="include" type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.0/jquery-ui.min.js"></script>
  187. <!-- End additional plugins -->
  188. </div>
  189. <div class="col2">
  190. <div class="example-link"><a class="example-link" href="data-renderers.html">AJAX and JSON Data Loading via Data Renderers</a></div>
  191. <div class="example-link"><a class="example-link" href="barLineAnimated.html">Animated Charts</a></div>
  192. <div class="example-link"><a class="example-link" href="dashboardWidget.html">Animated Dashboard Sample - Filled Line with Log Axis</a></div>
  193. <div class="example-link"><a class="example-link" href="kcp_area.html">Area Chart</a></div>
  194. <div class="example-link"><a class="example-link" href="kcp_area2.html">Area Chart 2</a></div>
  195. <div class="example-link"><a class="example-link" href="axisLabelTests.html">Axis Labels</a></div>
  196. <div class="example-link"><a class="example-link" href="axisLabelsRotatedText.html">Axis Labels and Rotated Text</a></div>
  197. <div class="example-link"><a class="example-link" href="barTest.html">Bar Charts</a></div>
  198. <div class="example-link"><a class="example-link" href="multipleBarColors.html">Bar Colors Example</a></div>
  199. <div class="example-link"><a class="example-link" href="bezierCurve.html">Bezier Curve Plots</a></div>
  200. <div class="example-link"><a class="example-link" href="blockPlot.html">Block Plots</a></div>
  201. <div class="example-link"><a class="example-link" href="bubbleChart.html">Bubble Charts</a></div>
  202. <div class="example-link"><a class="example-link" href="bubble-plots.html">Bubble Plots</a></div>
  203. <div class="example-link"><a class="example-link" href="candlestick.html">Candlestick and Open Hi Low Close Charts</a></div>
  204. <div class="example-link"><a class="example-link" href="theming.html">Chart Theming</a></div>
  205. <div class="example-link"><a class="example-link" href="fillBetweenLines.html">Charts with Fill Between Lines</a></div>
  206. <div class="example-link"><a class="example-link" href="kcp_cdf.html">Cumulative Density Function Chart</a></div>
  207. <div class="example-link"><a class="example-link" href="dashedLines.html">Dashed Lines with Smoothing</a></div>
  208. <div class="example-link"><a class="example-link" href="cursor-highlighter.html">Data Point Highlighting, Tooltips and Cursor Tracking</a></div>
  209. <div class="example-link"><a class="example-link" href="point-labels.html">Data Point labels</a></div>
  210. <div class="example-link"><a class="example-link" href="date-axes.html">Date Axes</a></div>
  211. <div class="example-link"><a class="example-link" href="dateAxisRenderer.html">Date Axes 2</a></div>
  212. <div class="example-link"><a class="example-link" href="rotatedTickLabelsZoom.html">Date Axes, Rotated Labels and Zooming</a></div>
  213. <div class="example-link"><a class="example-link" href="canvas-overlay.html">Draw Lines on Plots - Canvas Overlay</a></div>
  214. <div class="example-link"><a class="example-link" href="draw-rectangles.html">Draw Rectangles on Plots</a></div>
  215. <div class="example-link"><a class="example-link" href="kcp_engel.html">Engel Curves</a></div>
  216. <div class="example-link"><a class="example-link" href="bandedLine.html">Error Bands and Confidence Intervals</a></div>
  217. <div class="example-link"><a class="example-link" href="area.html">Filled (Area) Charts</a></div>
  218. <div class="example-link"><a class="example-link" href="axisScalingForceTickAt.html">Force Plot to Have Tick at 0 or 100</a></div>
  219. <div class="example-link"><a class="example-link" href="hiddenPlotsInTabs.html">Hidden Plots</a></div>
  220. <div class="example-link"><a class="example-link" href="customHighlighterCursorTrendline.html">Highlighting, Dragging Points, Cursor and Trend Lines</a></div>
  221. <div class="example-link"><a class="example-link" href="line-charts.html">Line Charts and Options</a></div>
  222. <div class="example-link"><a class="example-link" href="kcp_lorenz.html">Lorenz Curves</a></div>
  223. <div class="example-link"><a class="example-link" href="mekkoCharts.html">Mekko Charts</a></div>
  224. <div class="example-link"><a class="example-link" href="meterGauge.html">Meter Gauge</a></div>
  225. <div class="example-link"><a class="example-link" href="candlestick-charts.html">Open Hi Low Close and Candlestick Charts</a></div>
  226. <div class="example-link"><a class="example-link" href="pieTest.html">Pie Charts and Options</a></div>
  227. <div class="example-link"><a class="example-link" href="pieTest4.html">Pie Charts and Options 2</a></div>
  228. <div class="example-link"><a class="example-link" href="pie-donut-charts.html">Pie and Donut Charts</a></div>
  229. <div class="example-link"><a class="example-link" href="selectorSyntax.html">Plot Creation with jQuery Selectors</a></div>
  230. <div class="example-link"><a class="example-link" href="zooming.html">Plot Zooming and Cursor Control</a></div>
  231. <div class="example-link"><a class="example-link" href="kcp_pdf.html">Probability Density Function Chart</a></div>
  232. <div class="example-link"><a class="example-link" href="kcp_pyramid_by_age.html">Pyramid Chart By Age</a></div>
  233. <div class="example-link"><a class="example-link" href="kcp_pyramid.html">Pyramid Charts</a></div>
  234. <div class="example-link"><a class="example-link" href="kcp_pyramid2.html">Pyramid Charts 2</a></div>
  235. <div class="example-link"><a class="example-link" href="kcp_quintiles.html">Quintile Pyramid Charts</a></div>
  236. <div class="example-link"><a class="example-link" href="resizablePlot.html">Resizable Plots</a></div>
  237. <div class="example-link"><a class="example-link" href="rotated-tick-labels.html">Rotated Labels and Font Styling</a></div>
  238. <div class="example-link"><a class="example-link" href="smoothedLine.html">Smoothed Lines</a></div>
  239. <div class="example-link"><a class="example-link" href="bar-charts.html">Vertical and Horizontal Bar Charts</a></div>
  240. <div class="example-link"><a class="example-link" href="waterfall.html">Waterfall Charts</a></div>
  241. <div class="example-link"><a class="example-link" href="waterfall2.html">Waterfall Charts 2</a></div>
  242. <div class="example-link"><a class="example-link" href="zoomOptions.html">Zoom Options</a></div>
  243. <div class="example-link"><a class="example-link" href="zoomProxy.html">Zoom Proxy - Control one plot from another</a></div>
  244. <div class="example-link"><a class="example-link" href="zoom1.html">Zooming</a></div>
  245. <div class="example-link"><a class="example-link" href="dateAxisLogAxisZooming.html">Zooming with Date and Log Axes</a></div>
  246. </div>
  247. </div>
  248. </div>
  249. <script type="text/javascript" src="example.min.js"></script>
  250. </body>
  251. </html>