]>
git.proxmox.com Git - sencha-touch.git/blob - src/src/chart/series/sprite/Area.js
2 * @class Ext.chart.series.sprite.Area
3 * @extends Ext.chart.series.sprite.StackedCartesian
7 Ext
.define("Ext.chart.series.sprite.Area", {
8 alias
: 'sprite.areaSeries',
9 extend
: "Ext.chart.series.sprite.StackedCartesian",
15 * @cfg {Boolean} [step=false] 'true' if the area is represented with steps instead of lines.
25 renderClipped: function (surface
, ctx
, clip
, clipRegion
) {
30 dataStartY
= attr
.dataStartY
,
32 x
, y
, i
, lastX
, lastY
,
33 xx
= matrix
.elements
[0],
34 dx
= matrix
.elements
[4],
35 yy
= matrix
.elements
[3],
36 dy
= matrix
.elements
[5],
37 surfaceMatrix
= me
.surfaceMatrix
,
39 start
= Math
.max(0, this.binarySearch(clip
[0])),
40 end
= Math
.min(dataX
.length
- 1, this.binarySearch(clip
[2]) + 1);
44 lastY
= dataY
[start
] * yy
+ dy
;
45 for (i
= start
; i
<= end
; i
++) {
46 x
= dataX
[i
] * xx
+ dx
;
47 y
= dataY
[i
] * yy
+ dy
;
49 ctx
.lineTo(x
, lastY
= y
);
52 for (i
= start
; i
<= end
; i
++) {
53 x
= dataX
[i
] * xx
+ dx
;
54 y
= dataY
[i
] * yy
+ dy
;
61 lastX
= dataX
[end
] * xx
+ dx
;
62 for (i
= end
; i
>= start
; i
--) {
63 x
= dataX
[i
] * xx
+ dx
;
64 y
= dataStartY
[i
] * yy
+ dy
;
66 ctx
.lineTo(lastX
= x
, y
);
69 for (i
= end
; i
>= start
; i
--) {
70 x
= dataX
[i
] * xx
+ dx
;
71 y
= dataStartY
[i
] * yy
+ dy
;
76 // dataStartY[i] == 0;
77 ctx
.lineTo(dataX
[end
] * xx
+ dx
, y
);
78 ctx
.lineTo(dataX
[end
] * xx
+ dx
, dy
);
79 ctx
.lineTo(dataX
[start
] * xx
+ dx
, dy
);
80 ctx
.lineTo(dataX
[start
] * xx
+ dx
, dataY
[i
] * yy
+ dy
);
82 if (attr
.transformFillStroke
) {
83 attr
.matrix
.toContext(ctx
);
86 if (attr
.transformFillStroke
) {
87 attr
.inverseMatrix
.toContext(ctx
);
91 for (i
= start
; i
<= end
; i
++) {
92 x
= dataX
[i
] * xx
+ dx
;
93 y
= dataY
[i
] * yy
+ dy
;
95 ctx
.lineTo(x
, lastY
= y
);
96 markerCfg
.translationX
= surfaceMatrix
.x(x
, y
);
97 markerCfg
.translationY
= surfaceMatrix
.y(x
, y
);
98 me
.putMarker("markers", markerCfg
, i
, !attr
.renderer
);
101 for (i
= start
; i
<= end
; i
++) {
102 x
= dataX
[i
] * xx
+ dx
;
103 y
= dataY
[i
] * yy
+ dy
;
105 markerCfg
.translationX
= surfaceMatrix
.x(x
, y
);
106 markerCfg
.translationY
= surfaceMatrix
.y(x
, y
);
107 me
.putMarker("markers", markerCfg
, i
, !attr
.renderer
);
111 if (attr
.transformFillStroke
) {
112 attr
.matrix
.toContext(ctx
);