]>
git.proxmox.com Git - extjs.git/blob - extjs/packages/charts/src/chart/interactions/RotatePie3D.js
2 * @class Ext.chart.interactions.RotatePie3D
3 * @extends Ext.chart.interactions.Rotate
5 * A special version of the Rotate interaction used by Pie3D Chart.
7 Ext
.define('Ext.chart.interactions.RotatePie3D', {
9 extend
: 'Ext.chart.interactions.Rotate',
13 alias
: 'interaction.rotatePie3d',
15 getAngle: function (e
) {
16 var chart
= this.getChart(),
17 rtl
= chart
.getInherited().rtl
,
18 direction
= rtl
? -1 : 1,
20 xy
= chart
.element
.getXY(),
21 rect
= chart
.getMainRect();
23 return direction
* Math
.atan2(
24 pageXY
[1] - xy
[1] - rect
[3] * 0.5,
25 pageXY
[0] - xy
[0] - rect
[2] * 0.5
29 getRadius: function (e
) {
30 var chart
= this.getChart(),
31 radius
= chart
.getRadius(),
32 seriesList
= chart
.getSeries(),
33 ln
= seriesList
.length
,
37 // With 3D pie series, series may have a radius that is
38 // different from the radius of the chart, because the 'pie3d'
39 // series will automatically adjust its radius based on
40 // distortion, thickness and other configs.
41 // It's not critical to check if the series radius is smaller
42 // than the chart radius, since the base Rotate interaction
43 // will rotate all series there are anyway.
44 // Rotating series individually (i.e. if having multiple concentric
45 // pie series) is not possible with neither this nor the base Rotate
48 series
= seriesList
[i
];
50 seriesRadius
= series
.getRadius();
51 if (seriesRadius
> radius
) {
52 radius
= seriesRadius
;