1 of 2

http://softwareinventor.wordpress.com/2013/01/11/extjs-menampilkan-ba...

view source
print?
01 </pre>
02 Ext.onReady(function () {
03 var store = Ext.create('Ext.data.JsonStore', {
04 fields: ['name', 'data'],
05 data: [{
06 'name': 'Kandidat 1',
07 'data': 4
08 }, {
09 'name': 'Kandidat 2',
10 'data': 2
11 }, {
12 'name': 'Kandidat 3',
13 'data': 9
14 }, {
15 'name': 'Kandidat 4',
16 'data': 14
17 }, {
18 'name': 'Kandidat 5',
19 'data': 21
20 }]
21 });
22
23 Ext.create('Ext.chart.Chart', {
24 renderTo: Ext.getBody(),
25 width: 500,
26 height: 300,
27 animate: true,
28 store: store,
29 axes: [{
30 type: 'Numeric',
31 position: 'bottom',
32 fields: ['data'],
33 label: {
34 renderer: Ext.util.Format.numberRenderer('0,0')
35 },
36 title: 'Jumlah Pemilih',
37 grid: true,
38 minimum: 0
39 }, {
40 type: 'Category',
41 position: 'left',
42 fields: ['name'],
43 title: 'Nama Kandidat'

1/22/2013 4:07 PM

53 renderer: function (storeItem.. 62 color: '#333'. 69 }). 1/22/2013 4:07 PM . 57 label: { 58 display: 'insideEnd'.get('data') + ' views'). 59 field: 'data'.com/2013/01/11/extjs-menampilkan-ba.wordpress. item) { 54 this. 51 width: 140. 52 height: 28. 55 } 56 }. 63 'text-anchor': 'middle' 64 }. 65 xField: 'name'.get('name') + ': ' + storeItem.setTitle(storeItem. 60 renderer: Ext. 44 }]. 47 axis: 'bottom'. 45 series: [{ 46 type: 'bar'.util.numberRenderer('0').2 of 2 http://softwareinventor. 61 orientation: 'horizontal'.. 49 tips: { 50 trackMouse: true.Format. 66 yField: 'data' 67 }] 68 }). 48 highlight: true.

Sign up to vote on this title
UsefulNot useful