]>
git.proxmox.com Git - sencha-touch.git/blob - src/examples/states/app/view/Pyramid.js
5 Ext
.define('States.view.Pyramid', {
6 extend
: 'Ext.chart.series.Cartesian',
9 alias
: 'series.pyramid',
10 seriesType
: 'barSeries',
15 * @cfg style Style properties that will override the theming series styles.
19 * @cfg {Number} xPadding Padding between the left/right axes and the pyramids
24 * @cfg {Number} yPadding Padding between the top/bottom axes and the pyramids
32 colors
: ['rgb(166, 206, 227)', 'rgb(31, 120, 180)'],
50 fieldCategoryY
: ['Y1', 'Y2'],
52 coordinateY: function () {
54 store
= me
.getStore(),
55 items
= store
.getData().items
,
56 range
= {min
: Infinity
, max
: -Infinity
},
58 sprites
= me
.getSprites();
60 if (sprites
.length
> 0) {
61 data
= me
.coordinateData(items
, this.getY1Field());
62 for (i
= 0; i
< data
.length
; i
++) {
65 me
.getRangeOfData(data
, range
);
67 sprites
[0].setAttributes(style
);
70 data
= me
.coordinateData(items
, this.getY2Field());
71 me
.getRangeOfData(data
, range
);
73 sprites
[1].setAttributes(style
);
74 me
.dataRange
[1] = range
.min
;
75 me
.dataRange
[3] = range
.max
;
79 getSprites: function () {
81 chart
= this.getChart(),
82 animation
= chart
&& chart
.getAnimate(),
89 if (sprites
.length
=== 2) {
90 me
.getLabel().getTemplate().fx
.setConfig(animation
);
91 sprites
[0].fx
.setConfig(animation
);
92 sprites
[0].itemsMarker
.getTemplate().fx
.setConfig(animation
);
93 sprites
[1].fx
.setConfig(animation
);
94 sprites
[1].itemsMarker
.getTemplate().fx
.setConfig(animation
);
100 me
.setHidden([false, false]);
104 provideLegendInfo: function (target
) {
105 var store
= this.getStore();
107 var hidden
= this.getHidden();
108 for (var i
= 0; i
< 2; i
++) {
110 name
: ['Female', 'Male'][i
],
111 mark
: this.getStyleByIndex(i
).fillStyle
|| this.getStyleByIndex(i
).strokeStyle
|| 'black',
113 series
: this.getId(),