3 * @class Ext.chart.series.Polar
4 * @extends Ext.chart.series.Series
6 * Common base class for series implementations that plot values using polar coordinates.
8 * Polar charts accept angles in radians. You can calculate radians with the following
11 * radians = degrees x Π/180
13 Ext
.define('Ext.chart.series.Polar', {
15 extend
: 'Ext.chart.series.Series',
20 * @cfg {Number} [rotation=0]
21 * The angle in radians at which the first polar series item should start.
26 * @cfg {Number} radius
28 * Use {@link Ext.chart.series.Pie#cfg!radiusFactor radiusFactor} instead.
30 * The internally used radius of the polar series. Set to `null` will fit the
31 * polar series to the boundary.
36 * @cfg {Array} center for the polar series.
41 * @cfg {Number} [offsetX=0]
42 * The x-offset of center of the polar series related to the center of the boundary.
47 * @cfg {Number} [offsetY=0]
48 * The y-offset of center of the polar series related to the center of the boundary.
53 * @cfg {Boolean} [showInLegend=true]
54 * Whether to add the series elements as legend items.
60 * @cfg {String} xField
66 * @cfg {String} yField
71 * @cfg {String} angleField
72 * The store record field name for the angular axes in radar charts,
73 * or the size of the slices in pie charts.
78 * @cfg {String} radiusField
79 * The store record field name for the radial axes in radar charts,
80 * or the radius of the slices in pie charts.
89 directions
: ['X', 'Y'],
90 fieldCategoryX
: ['X'],
91 fieldCategoryY
: ['Y'],
95 lengthField
: 'radiusField'
98 constructor: function(config
) {
100 configurator
= me
.self
.getConfigurator(),
101 configs
= configurator
.configs
,
105 for (p
in me
.deprecatedConfigs
) {
106 if (p
in config
&& !(config
in configs
)) {
107 Ext
.raise("'" + p
+ "' config has been deprecated. Please use the '" +
108 me
.deprecatedConfigs
[p
] + "' config instead.");
113 me
.callParent([config
]);
116 getXField: function() {
117 return this.getAngleField();
120 updateXField: function(value
) {
121 this.setAngleField(value
);
124 getYField: function() {
125 return this.getRadiusField();
128 updateYField: function(value
) {
129 this.setRadiusField(value
);
132 applyXAxis: function(newAxis
, oldAxis
) {
133 return this.getChart().getAxis(newAxis
) || oldAxis
;
136 applyYAxis: function(newAxis
, oldAxis
) {
137 return this.getChart().getAxis(newAxis
) || oldAxis
;
140 getXRange: function() {
141 return [this.dataRange
[0], this.dataRange
[2]];
144 getYRange: function() {
145 return [this.dataRange
[1], this.dataRange
[3]];
148 themeColorCount: function() {
150 store
= me
.getStore(),
151 count
= store
&& store
.getCount() || 0;
156 isStoreDependantColorCount
: true,
158 getDefaultSpriteConfig: function() {
160 type
: this.seriesType
,
161 renderer
: this.getRenderer(),
169 applyRotation: function(rotation
) {
170 return Ext
.draw
.sprite
.AttributeParser
.angle(Ext
.draw
.Draw
.rad(rotation
));
173 updateRotation: function(rotation
) {
174 var sprites
= this.getSprites();
176 if (sprites
&& sprites
[0]) {
177 sprites
[0].setAttributes({
178 baseRotation
: rotation