]> git.proxmox.com Git - extjs.git/blame - extjs/packages/charts/src/chart/grid/VerticalGrid.js
add extjs 6.0.1 sources
[extjs.git] / extjs / packages / charts / src / chart / grid / VerticalGrid.js
CommitLineData
6527f429
DM
1/**\r
2 * @class Ext.chart.grid.VerticalGrid\r
3 * @extends Ext.draw.sprite.Sprite\r
4 * \r
5 * Vertical Grid sprite. Used in Cartesian Charts.\r
6 */\r
7Ext.define('Ext.chart.grid.VerticalGrid', {\r
8 extend: 'Ext.draw.sprite.Sprite',\r
9 alias: 'grid.vertical',\r
10\r
11 inheritableStatics: {\r
12 def: {\r
13 processors: {\r
14 x: 'number',\r
15 y: 'number',\r
16 width: 'number',\r
17 height: 'number'\r
18 },\r
19\r
20 defaults: {\r
21 x: 0,\r
22 y: 0,\r
23 width: 1,\r
24 height: 1,\r
25 strokeStyle: '#DDD'\r
26 }\r
27 }\r
28 },\r
29\r
30 render: function (surface, ctx, clipRect) {\r
31 var attr = this.attr,\r
32 x = surface.roundPixel(attr.x),\r
33 halfLineWidth = ctx.lineWidth * 0.5;\r
34\r
35 ctx.beginPath();\r
36 ctx.rect(x - halfLineWidth, clipRect[1] - surface.matrix.getDY(), attr.width, clipRect[3]);\r
37 ctx.fill();\r
38\r
39 ctx.beginPath();\r
40 ctx.moveTo(x - halfLineWidth, clipRect[1] - surface.matrix.getDY());\r
41 ctx.lineTo(x - halfLineWidth, clipRect[1] + clipRect[3] - surface.matrix.getDY());\r
42 ctx.stroke();\r
43 }\r
44});