]>
Commit | Line | Data |
---|---|---|
6527f429 DM |
1 | /**\r |
2 | * @class Ext.chart.grid.HorizontalGrid3D\r | |
3 | * @extends Ext.chart.grid.HorizontalGrid\r | |
4 | *\r | |
5 | * Horizontal 3D Grid sprite. Used in 3D Cartesian Charts.\r | |
6 | */\r | |
7 | Ext.define('Ext.chart.grid.HorizontalGrid3D', {\r | |
8 | extend: 'Ext.chart.grid.HorizontalGrid',\r | |
9 | alias: 'grid.horizontal3d',\r | |
10 | \r | |
11 | inheritableStatics: {\r | |
12 | def: {\r | |
13 | processors: {\r | |
14 | depth: 'number'\r | |
15 | },\r | |
16 | \r | |
17 | defaults: {\r | |
18 | depth: 0\r | |
19 | }\r | |
20 | }\r | |
21 | },\r | |
22 | \r | |
23 | render: function (surface, ctx, clipRect) {\r | |
24 | var attr = this.attr,\r | |
25 | x = surface.roundPixel(attr.x),\r | |
26 | y = surface.roundPixel(attr.y),\r | |
27 | dx = surface.matrix.getDX(),\r | |
28 | halfLineWidth = ctx.lineWidth * 0.5,\r | |
29 | height = attr.height,\r | |
30 | depth = attr.depth,\r | |
31 | left, top;\r | |
32 | \r | |
33 | if (y <= clipRect[1]) {\r | |
34 | return;\r | |
35 | }\r | |
36 | \r | |
37 | // Horizontal stripe.\r | |
38 | \r | |
39 | left = clipRect[0] + depth - dx;\r | |
40 | top = y + halfLineWidth - depth;\r | |
41 | \r | |
42 | ctx.beginPath();\r | |
43 | ctx.rect(left, top, clipRect[2], height);\r | |
44 | ctx.fill();\r | |
45 | \r | |
46 | // Horizontal line.\r | |
47 | \r | |
48 | ctx.beginPath();\r | |
49 | ctx.moveTo(left, top);\r | |
50 | ctx.lineTo(left + clipRect[2], top);\r | |
51 | ctx.stroke();\r | |
52 | \r | |
53 | // Diagonal stripe.\r | |
54 | \r | |
55 | left = clipRect[0] + x - dx;\r | |
56 | top = y + halfLineWidth;\r | |
57 | \r | |
58 | ctx.beginPath();\r | |
59 | ctx.moveTo(left, top);\r | |
60 | ctx.lineTo(left + depth, top - depth);\r | |
61 | ctx.lineTo(left + depth, top - depth + height);\r | |
62 | ctx.lineTo(left, top + height);\r | |
63 | ctx.closePath();\r | |
64 | ctx.fill();\r | |
65 | \r | |
66 | // Diagonal line.\r | |
67 | \r | |
68 | ctx.beginPath();\r | |
69 | ctx.moveTo(left, top);\r | |
70 | ctx.lineTo(left + depth, top - depth);\r | |
71 | ctx.stroke();\r | |
72 | }\r | |
73 | }); |