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