2 * @class Ext.chart.Shape
5 Ext.define('Ext.chart.Shape', {
7 /* Begin Definitions */
13 circle: function (surface, opts) {
14 return surface.add(Ext.apply({
22 line: function (surface, opts) {
23 return surface.add(Ext.apply({
25 x: opts.x - opts.radius,
26 y: opts.y - opts.radius,
27 height: 2 * opts.radius,
28 width: 2 * opts.radius / 5
31 square: function (surface, opts) {
32 return surface.add(Ext.applyIf({
34 x: opts.x - opts.radius,
35 y: opts.y - opts.radius,
36 height: 2 * opts.radius,
37 width: 2 * opts.radius,
41 triangle: function (surface, opts) {
43 return surface.add(Ext.apply({
46 path: "M".concat(opts.x, ",", opts.y, "m0-", opts.radius * 0.58, "l", opts.radius * 0.5, ",", opts.radius * 0.87, "-", opts.radius, ",0z")
49 diamond: function (surface, opts) {
52 return surface.add(Ext.apply({
55 path: ["M", opts.x, opts.y - r, "l", r, r, -r, r, -r, -r, r, -r, "z"]
58 cross: function (surface, opts) {
61 return surface.add(Ext.apply({
64 path: "M".concat(opts.x - r, ",", opts.y, "l", [-r, -r, r, -r, r, r, r, -r, r, r, -r, r, r, r, -r, r, -r, -r, -r, r, -r, -r, "z"])
67 plus: function (surface, opts) {
68 var r = opts.radius / 1.3;
69 return surface.add(Ext.apply({
72 path: "M".concat(opts.x - r / 2, ",", opts.y - r / 2, "l", [0, -r, r, 0, 0, r, r, 0, 0, r, -r, 0, 0, r, -r, 0, 0, -r, -r, 0, 0, -r, "z"])
75 arrow: function (surface, opts) {
77 return surface.add(Ext.apply({
79 path: "M".concat(opts.x - r * 0.7, ",", opts.y - r * 0.4, "l", [r * 0.6, 0, 0, -r * 0.4, r, r * 0.8, -r, r * 0.8, 0, -r * 0.4, -r * 0.6, 0], "z")
82 drop: function (surface, x, y, text, size, angle) {
87 path: ['M', x, y, 'l', size, 0, 'A', size * 0.4, size * 0.4, 0, 1, 0, x + size * 0.7, y - size * 0.7, 'z'],
91 degrees: 22.5 - angle,
96 angle = (angle + 90) * Math.PI / 180;
99 x: x + size * Math.sin(angle) - 10, // Shift here, Not sure why.
100 y: y + size * Math.cos(angle) + 5,
102 'font-size': size * 12 / 40,