Repository navigation
Expand file tree
/
Copy pathinversed.js
More file actions
69 lines (66 loc) · 2.35 KB
/
Copy pathinversed.js
File metadata and controls
69 lines (66 loc) · 2.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/**
* Heatmap Inversed Axis sample
*/
this.default = function () {
var heatmap = new ej.heatmap.HeatMap({
titleSettings: {
text: 'Population Growth Rate of the most Populous Countries',
textStyle: {
size: '15px',
fontWeight: '500',
fontStyle: 'Normal',
fontFamily: 'Segoe UI'
}
},
xAxis: {
labels: ['China', 'India', 'USA', 'Indonesia', 'Brazil', 'Pakistan',
'Nigeria', 'Bangladesh', 'Russia', 'Mexico'],
labelRotation: 45,
labelIntersectAction: 'None',
isInversed: true
},
yAxis: {
labels: ['1965-1970', '1970-1975', '1975-1980', '1980-1985', '1985-1990',
'1990-1995', '1995-2000', '2000-2005', '2005-2010', '2010-2015'],
isInversed: true
},
dataSource: window.inveredAxisData,
cellSettings: {
border: {
width: 0
},
showLabel: false,
format: '{value} %'
},
paletteSettings: {
palette: [{ value: 0, color: '#4b7287' },
{ value: 0.5, color: '#b5b29f' },
{ value: 1, color: '#F0D6AD' },
{ value: 1.5, color: '#9da49a' },
{ value: 2, color: '#466f86' },
{ value: 2.5, color: '#d7c7a7' },
{ value: 3, color: '#6e888f' },
],
},
load: function (args) {
var inversedAxisTheme = location.hash.split('/')[1];
inversedAxisTheme = inversedAxisTheme ? inversedAxisTheme : 'Material';
args.heatmap.theme = (inversedAxisTheme.charAt(0).toUpperCase() +
inversedAxisTheme.slice(1));
},
legendSettings: {
visible: false
},
});
heatmap.appendTo('#container');
var xlistObj = new ej.buttons.CheckBox({ label: 'Reverse X-Axis Origin', checked: true, change: valueXChange });
xlistObj.appendTo('#XOpposedPosition');
function valueXChange() {
heatmap.xAxis.isInversed = xlistObj.checked;
}
var ylistObj = new ej.buttons.CheckBox({ label: 'Reverse Y-Axis Origin', checked: true, change: valueYChange });
ylistObj.appendTo('#YOpposedPosition');
function valueYChange() {
heatmap.yAxis.isInversed = ylistObj.checked;
}
};