-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchart.js
More file actions
105 lines (97 loc) · 3.08 KB
/
chart.js
File metadata and controls
105 lines (97 loc) · 3.08 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
$('#container').highcharts({
chart: {
type: 'column',
backgroundColor:'rgba(255, 255, 255, 0.1)'
},
title: {
text : ''
},
events: {
load: function () {
//add report div
var ch = this,
x = 20,
y = 57;
ch.flashText = ch.renderer.text('<div id="flash"><div id="report"></div></div>', x , y +10, true).attr({
zIndex: 101
}).add();
}
},
legend : {
itemEvents: {
dblclick: function (event) {
var found = false;
jQuery.each(projectsInfo, function(id, value) {
if(value.name == event.target.innerHTML)
{
window.open(redmineBaseUri + 'projects/' + id + '/issues/new','_blank');
found = true;
}
});
// let's do something if not found
if(!found)
alert('Project named ' + event.target.innerHTML + ' not configured in settings.js');
return false;
}
}
},
credits : {
enabled : false
},
plotOptions: {
series: {
stacking: 'normal',
pointWidth: 20,
animation: false,
events: {
legendItemClick: function(event){
var seriesIndex = this.index;
var series = this.chart.series;
for (var i = 0; i < series.length; i++) {
// rather than calling 'show()' and 'hide()' on the series', we use setVisible and then
// call chart.redraw --- this is significantly faster since it involves fewer chart redraws
if (series[i].index === seriesIndex) {
if (!series[i].visible) series[i].setVisible(true, false);
} else {
if (series[i].visible) series[i].setVisible(false, false);
}
}
this.chart.redraw();
model.forceVisibleProjectsDummy.notifySubscribers();
return false;
}
}
}
},
xAxis: {
type: 'datetime',
tickPositioner: function() {
var ticks = [];
$.each(this.series, function (index ,value) {
ticks = ticks.concat(value.xData);
});
return ticks;
},
labels: {
rotation : 25,
formatter: function() {
return Highcharts.dateFormat('%a %d', this.value);
}
}
},
yAxis: {
labels: {
enabled : false
},
title: {
text: null
},
stackLabels: {
enabled: true,
style: {
fontWeight: 'bold',
color: (Highcharts.theme && Highcharts.theme.textColor) || 'gray'
}
}
}
});