]>
Commit | Line | Data |
---|---|---|
6527f429 DM |
1 | /**\r |
2 | * This example shows how to define multiple axes in a single direction. It also shows\r | |
3 | * how to have slave axes linked to the master axis. Slave axes mirror the data and the\r | |
4 | * layout of the master axis, but can be styled and positioned differently. The example\r | |
5 | * also shows how to use gradients in charts.\r | |
6 | *\r | |
7 | * Click and drag to select a region to zoom into. Double-click to undo the last zoom.\r | |
8 | */\r | |
9 | Ext.define('KitchenSink.view.charts.column.MultiAxis', {\r | |
10 | extend: 'Ext.container.Container',\r | |
11 | xtype: 'column-multi-axis',\r | |
12 | controller: 'column-multi-axis',\r | |
13 | \r | |
14 | // <example>\r | |
15 | // Content between example tags is omitted from code preview.\r | |
16 | layout: 'fit',\r | |
17 | otherContent: [{\r | |
18 | type: 'Controller',\r | |
19 | path: 'classic/samples/view/charts/column/MultiAxisController.js'\r | |
20 | }, {\r | |
21 | type: 'Store',\r | |
22 | path: 'classic/samples/store/Climate.js'\r | |
23 | }],\r | |
24 | // </example>\r | |
25 | width: 650,\r | |
26 | height: 500,\r | |
27 | \r | |
28 | items: [{\r | |
29 | xtype: 'cartesian',\r | |
30 | reference: 'chart',\r | |
31 | store: {\r | |
32 | type: 'climate'\r | |
33 | },\r | |
34 | insetPadding: 10,\r | |
35 | innerPadding: {\r | |
36 | left: 20,\r | |
37 | right: 20\r | |
38 | },\r | |
39 | interactions: 'crosszoom',\r | |
40 | axes: [\r | |
41 | {\r | |
42 | type: 'numeric',\r | |
43 | id: 'fahrenheit-axis',\r | |
44 | adjustByMajorUnit: true,\r | |
45 | position: 'left',\r | |
46 | titleMargin: 20,\r | |
47 | minimum: 32,\r | |
48 | grid: true,\r | |
49 | title: {\r | |
50 | text: 'Temperature in °F'\r | |
51 | },\r | |
52 | listeners: {\r | |
53 | rangechange: 'onAxisRangeChange'\r | |
54 | }\r | |
55 | },\r | |
56 | {\r | |
57 | id: 'celsius-axis',\r | |
58 | type: 'numeric',\r | |
59 | titleMargin: 20,\r | |
60 | position: 'right',\r | |
61 | title: {\r | |
62 | text: 'Temperature in °C',\r | |
63 | fillStyle: 'red'\r | |
64 | }\r | |
65 | },\r | |
66 | {\r | |
67 | id: 'months-axis',\r | |
68 | type: 'category',\r | |
69 | position: 'bottom'\r | |
70 | },\r | |
71 | {\r | |
72 | position: 'top',\r | |
73 | linkedTo: 'months-axis',\r | |
74 | title: {\r | |
75 | text: 'Climate data for Redwood City, California',\r | |
76 | fillStyle: 'green'\r | |
77 | },\r | |
78 | titleMargin: 20\r | |
79 | }\r | |
80 | ],\r | |
81 | // Series are dynamically added in the view controller.\r | |
82 | gradients: [{\r | |
83 | id: 'rainbow',\r | |
84 | type: 'linear',\r | |
85 | degrees: 270,\r | |
86 | stops: [\r | |
87 | {\r | |
88 | offset: 0,\r | |
89 | color: '#78C5D6'\r | |
90 | },\r | |
91 | {\r | |
92 | offset: 0.14,\r | |
93 | color: '#449AA7'\r | |
94 | },\r | |
95 | {\r | |
96 | offset: 0.28,\r | |
97 | color: '#79C267'\r | |
98 | },\r | |
99 | {\r | |
100 | offset: 0.42,\r | |
101 | color: '#C4D546'\r | |
102 | },\r | |
103 | {\r | |
104 | offset: 0.56,\r | |
105 | color: '#F5D63D'\r | |
106 | },\r | |
107 | {\r | |
108 | offset: 0.70,\r | |
109 | color: '#F18B32'\r | |
110 | },\r | |
111 | {\r | |
112 | offset: 0.84,\r | |
113 | color: '#E767A1'\r | |
114 | },\r | |
115 | {\r | |
116 | offset: 1,\r | |
117 | color: '#BF62A6'\r | |
118 | }\r | |
119 | ]\r | |
120 | }]\r | |
121 | }],\r | |
122 | \r | |
123 | listeners: {\r | |
124 | afterrender: 'onAfterRender'\r | |
125 | }\r | |
126 | \r | |
127 | });\r |