4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5 <title>The source code</title>
6 <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
7 <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
8 <style type="text/css">
9 .highlight { display: block; background-color: #ddd; }
11 <script type="text/javascript">
12 function highlight() {
13 document.getElementById(location.hash.replace(/#/, "")).className = "highlight";
17 <body onload="prettyPrint(); highlight();">
18 <pre class="prettyprint lang-js"><span id='Ext-chart-Shape'>/**
19 </span> * @class Ext.chart.Shape
22 Ext.define('Ext.chart.Shape', {
24 /* Begin Definitions */
30 circle: function (surface, opts) {
31 return surface.add(Ext.apply({
39 line: function (surface, opts) {
40 return surface.add(Ext.apply({
42 x: opts.x - opts.radius,
43 y: opts.y - opts.radius,
44 height: 2 * opts.radius,
45 width: 2 * opts.radius / 5
48 square: function (surface, opts) {
49 return surface.add(Ext.applyIf({
51 x: opts.x - opts.radius,
52 y: opts.y - opts.radius,
53 height: 2 * opts.radius,
54 width: 2 * opts.radius,
58 triangle: function (surface, opts) {
60 return surface.add(Ext.apply({
63 path: "M".concat(opts.x, ",", opts.y, "m0-", opts.radius * 0.58, "l", opts.radius * 0.5, ",", opts.radius * 0.87, "-", opts.radius, ",0z")
66 diamond: function (surface, opts) {
69 return surface.add(Ext.apply({
72 path: ["M", opts.x, opts.y - r, "l", r, r, -r, r, -r, -r, r, -r, "z"]
75 cross: function (surface, opts) {
78 return surface.add(Ext.apply({
81 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"])
84 plus: function (surface, opts) {
85 var r = opts.radius / 1.3;
86 return surface.add(Ext.apply({
89 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"])
92 arrow: function (surface, opts) {
94 return surface.add(Ext.apply({
96 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")
99 drop: function (surface, x, y, text, size, angle) {
104 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'],
108 degrees: 22.5 - angle,
113 angle = (angle + 90) * Math.PI / 180;
116 x: x + size * Math.sin(angle) - 10, // Shift here, Not sure why.
117 y: y + size * Math.cos(angle) + 5,
119 'font-size': size * 12 / 40,