-
Notifications
You must be signed in to change notification settings - Fork 1
/
chartjs.install
102 lines (99 loc) · 3.89 KB
/
chartjs.install
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
<?php
/**
* @file
* Install/uninstall/update hooks for chartjs.
*/
/**
* Implements hook_install().
*/
function chartjs_install() {
// Set defaults for global chartjs settings.
variable_set('chartjs_animation', 'true');
variable_set('chartjs_animationSteps', '60');
variable_set('chartjs_animationEasing', 'easeOutQuart');
variable_set('chartjs_showScale', 'true');
variable_set('chartjs_scaleOverride', 'false');
variable_set('chartjs_scaleSteps', 'null');
variable_set('chartjs_scaleStepWidth', 'null');
variable_set('chartjs_scaleStartValue', 'null');
variable_set('chartjs_scaleLineColor', 'rgba(0,0,0,.1)');
variable_set('chartjs_scaleLineWidth', '1');
variable_set('chartjs_scaleShowLabels', 'true');
variable_set('chartjs_scaleLabel', '<%=value%>');
variable_set('chartjs_scaleIntegersOnly', 'true');
variable_set('chartjs_scaleBeginAtZero', 'false');
variable_set('chartjs_scaleFontFamily', "'Helvetica Neue', 'Helvetica', 'Arial', sans-serif");
variable_set('chartjs_scaleFontSize', '12');
variable_set('chartjs_scaleFontStyle', 'normal');
variable_set('chartjs_scaleFontColor', '#666');
variable_set('chartjs_responsive', 'false');
variable_set('chartjs_maintainAspectRatio', 'true');
variable_set('chartjs_showTooltips', 'true');
variable_set('chartjs_customTooltips', 'false');
variable_set('chartjs_tooltipFillColor', 'rgba(0,0,0,0.8)');
variable_set('chartjs_tooltipFontFamily', "'Helvetica Neue', 'Helvetica', 'Arial', sans-serif");
variable_set('chartjs_tooltipFontSize', '14');
variable_set('chartjs_tooltipFontStyle', 'normal');
variable_set('chartjs_tooltipFontColor', '#fff');
variable_set('chartjs_tooltipTitleFontFamily', "'Helvetica Neue', 'Helvetica', 'Arial', sans-serif");
variable_set('chartjs_tooltipTitleFontSize', '14');
variable_set('chartjs_tooltipTitleFontStyle', 'bold');
variable_set('chartjs_tooltipTitleFontColor', '#fff');
variable_set('chartjs_tooltipYPadding', '6');
variable_set('chartjs_tooltipXPadding', '6');
variable_set('chartjs_tooltipCaretSize', '6');
variable_set('chartjs_tooltipCornerRadius', '6');
variable_set('chartjs_tooltipXOffset', '10');
variable_set('chartjs_tooltipTemplate', '<%if (label){%><%=label%>: <%}%><%= value %>');
variable_set('chartjs_multiTooltipTemplate', '<%= value %>');
variable_set('chartjs_legendTemplate', '<ul class="<%=name.toLowerCase()%>-legend"><% for (var i=0; i<segments.length; i++){%><li><span style="background-color:<%=segments[i].fillColor%>"></span><%if(segments[i].label){%><%=segments[i].label%><%}%></li><%}%></ul>');
}
/**
* Implements hook_uninstall().
*/
function chartjs_uninstall() {
$variables = array(
'chartjs_animation',
'chartjs_animationSteps',
'chartjs_animationEasing',
'chartjs_showScale',
'chartjs_scaleOverride',
'chartjs_scaleSteps',
'chartjs_scaleStepWidth',
'chartjs_scaleStartValue',
'chartjs_scaleLineColor',
'chartjs_scaleLineWidth',
'chartjs_scaleShowLabels',
'chartjs_scaleLabel',
'chartjs_scaleIntegersOnly',
'chartjs_scaleBeginAtZero',
'chartjs_scaleFontFamily',
'chartjs_scaleFontSize',
'chartjs_scaleFontStyle',
'chartjs_scaleFontColor',
'chartjs_responsive',
'chartjs_maintainAspectRatio',
'chartjs_showTooltips',
'chartjs_customTooltips',
'chartjs_tooltipFillColor',
'chartjs_tooltipFontFamily',
'chartjs_tooltipFontSize',
'chartjs_tooltipFontStyle',
'chartjs_tooltipFontColor',
'chartjs_tooltipTitleFontFamily',
'chartjs_tooltipTitleFontSize',
'chartjs_tooltipTitleFontStyle',
'chartjs_tooltipTitleFontColor',
'chartjs_tooltipYPadding',
'chartjs_tooltipXPadding',
'chartjs_tooltipCaretSize',
'chartjs_tooltipCornerRadius',
'chartjs_tooltipXOffset',
'chartjs_tooltipTemplate',
'chartjs_multiTooltipTemplate',
'chartjs_legendTemplate',
);
foreach ($variables as $variable) {
variable_del($variable);
}
}