stacked-bar-chart.js
上传用户:shuoshiled
上传日期:2018-01-28
资源大小:10124k
文件大小:2k
源码类别:

中间件编程

开发平台:

JavaScript

  1. /*!  * Ext JS Library 3.0.0  * Copyright(c) 2006-2009 Ext JS, LLC  * licensing@extjs.com  * http://www.extjs.com/license  */ Ext.chart.Chart.CHART_URL = '../../resources/charts.swf';
  2. Ext.onReady(function(){
  3.     var store = new Ext.data.JsonStore({
  4.         fields: ['year', 'comedy', 'action', 'drama', 'thriller'],
  5.         data: [
  6.                 {year: 2005, comedy: 34000000, action: 23890000, drama: 18450000, thriller: 20060000},
  7.                 {year: 2006, comedy: 56703000, action: 38900000, drama: 12650000, thriller: 21000000},
  8.                 {year: 2007, comedy: 42100000, action: 50410000, drama: 25780000, thriller: 23040000},
  9.                 {year: 2008, comedy: 38910000, action: 56070000, drama: 24810000, thriller: 26940000}
  10.               ]
  11.     });
  12.     
  13.     new Ext.Panel({
  14.         width: 600,
  15.         height: 400,
  16.         renderTo: 'container',
  17.         title: 'Stacked Bar Chart - Movie Takings by Genre',
  18.         items: {
  19.             xtype: 'stackedbarchart',
  20.             store: store,
  21.             yField: 'year',
  22.             xAxis: new Ext.chart.NumericAxis({
  23.                 stackingEnabled: true,
  24.                 labelRenderer: Ext.util.Format.usMoney
  25.             }),
  26.             series: [{
  27.                 xField: 'comedy',
  28.                 displayName: 'Comedy'
  29.             },{
  30.                 xField: 'action',
  31.                 displayName: 'Action'
  32.             },{
  33.                 xField: 'drama',
  34.                 displayName: 'Drama'
  35.             },{
  36.                 xField: 'thriller',
  37.                 displayName: 'Thriller'
  38.             }]
  39.         }
  40.     });
  41. });