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 Ext
.define('Ext.chart.series.Polar', {
10 extend
: 'Ext.chart.series.Series',
14 * @cfg {Number} [rotation=0]
15 * The angle in degrees at which the first polar series item should start.
20 * @cfg {Number} radius
21 * The radius of the polar series. Set to `null` will fit the polar series to the boundary.
26 * @cfg {Array} center for the polar series.
31 * @cfg {Number} [offsetX=0]
32 * The x-offset of center of the polar series related to the center of the boundary.
37 * @cfg {Number} [offsetY=0]
38 * The y-offset of center of the polar series related to the center of the boundary.
43 * @cfg {Boolean} [showInLegend=true]
44 * Whether to add the series elements as legend items.
50 * @cfg {String} xField
56 * @cfg {String} yField
61 * @cfg {String} angleField
62 * The store record field name for the angular axes in radar charts,
63 * or the size of the slices in pie charts.
68 * @cfg {String} radiusField
69 * The store record field name for the radial axes in radar charts,
70 * or the radius of the slices in pie charts.
79 directions
: ['X', 'Y'],
80 fieldCategoryX
: ['X'],
81 fieldCategoryY
: ['Y'],
85 lengthField
: 'radiusField'
88 constructor: function (config
) {
90 configurator
= me
.getConfigurator(),
91 configs
= configurator
.configs
,
95 for (p
in me
.deprecatedConfigs
) {
96 if (p
in config
&& !(config
in configs
)) {
97 Ext
.raise("'" + p
+ "' config has been deprecated. Please use the '" +
98 me
.deprecatedConfigs
[p
] + "' config instead.");
102 me
.callParent([config
]);
105 getXField: function () {
106 return this.getAngleField();
109 updateXField: function (value
) {
110 this.setAngleField(value
);
113 getYField: function () {
114 return this.getRadiusField();
117 updateYField: function (value
) {
118 this.setRadiusField(value
);
121 applyXAxis: function (newAxis
, oldAxis
) {
122 return this.getChart().getAxis(newAxis
) || oldAxis
;
125 applyYAxis: function (newAxis
, oldAxis
) {
126 return this.getChart().getAxis(newAxis
) || oldAxis
;
129 getXRange: function () {
130 return [this.dataRange
[0], this.dataRange
[2]];
133 getYRange: function () {
134 return [this.dataRange
[1], this.dataRange
[3]];
137 themeColorCount: function() {
139 store
= me
.getStore(),
140 count
= store
&& store
.getCount() || 0;
145 isStoreDependantColorCount
: true,
147 getDefaultSpriteConfig: function () {
149 type
: this.seriesType
,
150 renderer
: this.getRenderer(),
158 applyRotation: function (rotation
) {
159 return Ext
.draw
.sprite
.AttributeParser
.angle(rotation
);
162 updateRotation: function (rotation
) {
163 var sprites
= this.getSprites();
164 if (sprites
&& sprites
[0]) {
165 sprites
[0].setAttributes({
166 baseRotation
: rotation