pie-chart.js
上传用户:dawnssy
上传日期:2022-08-06
资源大小:9345k
文件大小:1k
源码类别:

JavaScript

开发平台:

JavaScript

  1. /*!  * Ext JS Library 3.1.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: ['season', 'total'],
  5.         data: [{
  6.             season: 'Summer',
  7.             total: 150
  8.         },{
  9.             season: 'Fall',
  10.             total: 245
  11.         },{
  12.             season: 'Winter',
  13.             total: 117
  14.         },{
  15.             season: 'Spring',
  16.             total: 184
  17.         }]
  18.     });
  19.     
  20.     new Ext.Panel({
  21.         width: 400,
  22.         height: 400,
  23.         title: 'Pie Chart with Legend - Favorite Season',
  24.         renderTo: 'container',
  25.         items: {
  26.             store: store,
  27.             xtype: 'piechart',
  28.             dataField: 'total',
  29.             categoryField: 'season',
  30.             //extra styles get applied to the chart defaults
  31.             extraStyle:
  32.             {
  33.                 legend:
  34.                 {
  35.                     display: 'bottom',
  36.                     padding: 5,
  37.                     font:
  38.                     {
  39.                         family: 'Tahoma',
  40.                         size: 13
  41.                     }
  42.                 }
  43.             }
  44.         }
  45.     });
  46. });