]>
Commit | Line | Data |
---|---|---|
6527f429 DM |
1 | /**\r |
2 | * This example shows how to create a line chart with a renderer function that changes the\r | |
3 | * stroke and fill colors when the line goes down.\r | |
4 | *\r | |
5 | * Line charts allow to visualize the evolution of a value over time, or the ratio between\r | |
6 | * any two values.\r | |
7 | */\r | |
8 | Ext.define('KitchenSink.view.charts.line.Renderer', {\r | |
9 | extend: 'Ext.panel.Panel',\r | |
10 | xtype: 'line-renderer',\r | |
11 | controller: 'line-renderer',\r | |
12 | \r | |
13 | requires: [\r | |
14 | 'Ext.chart.CartesianChart',\r | |
15 | 'Ext.chart.series.Line',\r | |
16 | 'Ext.chart.axis.Numeric',\r | |
17 | 'Ext.draw.modifier.Highlight',\r | |
18 | 'Ext.chart.axis.Time',\r | |
19 | 'Ext.chart.interactions.ItemHighlight'\r | |
20 | ],\r | |
21 | \r | |
22 | layout: 'fit',\r | |
23 | \r | |
24 | width: 650,\r | |
25 | \r | |
26 | tbar: [\r | |
27 | '->',\r | |
28 | {\r | |
29 | text: 'Refresh',\r | |
30 | handler: 'onRefresh'\r | |
31 | }\r | |
32 | ],\r | |
33 | \r | |
34 | items: [{\r | |
35 | xtype: 'cartesian',\r | |
36 | reference: 'chart',\r | |
37 | width: '100%',\r | |
38 | height: 500,\r | |
39 | store: {\r | |
40 | type: 'pie'\r | |
41 | },\r | |
42 | interactions: {\r | |
43 | type: 'panzoom',\r | |
44 | zoomOnPanGesture: true\r | |
45 | },\r | |
46 | series: [\r | |
47 | {\r | |
48 | type: 'line',\r | |
49 | xField: 'name',\r | |
50 | yField: 'g1',\r | |
51 | fill: true,\r | |
52 | smooth: true,\r | |
53 | style: {\r | |
54 | lineWidth: 4\r | |
55 | },\r | |
56 | marker: {\r | |
57 | type: 'circle',\r | |
58 | radius: 10,\r | |
59 | lineWidth: 2\r | |
60 | },\r | |
61 | renderer: 'onSeriesRender'\r | |
62 | }\r | |
63 | ],\r | |
64 | axes: [\r | |
65 | {\r | |
66 | type: 'numeric',\r | |
67 | position: 'left',\r | |
68 | fields: ['g1'],\r | |
69 | minimum: 0,\r | |
70 | listeners: {\r | |
71 | rangechange: 'onAxisRangeChange'\r | |
72 | }\r | |
73 | },\r | |
74 | {\r | |
75 | type: 'category',\r | |
76 | position: 'bottom',\r | |
77 | fields: 'name'\r | |
78 | }\r | |
79 | ]\r | |
80 | }]\r | |
81 | \r | |
82 | });\r |