mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-23 18:48:51 +02:00
Merge remote-tracking branch 'origin/support/3.0' into develop
This commit is contained in:
@@ -1,5 +1,11 @@
|
||||
{# @copyright Copyright (C) 2010-2023 Combodo SARL #}
|
||||
{# @license http://opensource.org/licenses/AGPL-3.0 #}
|
||||
|
||||
var iChartDefaultHeight = 200,
|
||||
iChartLegendHeight = 6 * {{ oUIBlock.iMaxNbCharsInLabel }},
|
||||
iChartTotalHeight = iChartDefaultHeight+iChartLegendHeight;
|
||||
$('#my_chart_{{ oUIBlock.sId }}').height(iChartTotalHeight+'px');
|
||||
|
||||
var chart = c3.generate({
|
||||
bindto: d3.select('#my_chart_{{ oUIBlock.sId }}'),
|
||||
data: {
|
||||
|
||||
@@ -1,6 +1,12 @@
|
||||
{# @copyright Copyright (C) 2010-2023 Combodo SARL #}
|
||||
{# @license http://opensource.org/licenses/AGPL-3.0 #}
|
||||
|
||||
// Calculate height of graph : 200px (minimum height for the chart) + 20*iNbLinesToAddForName for the legend
|
||||
var iChartDefaultHeight = 200,
|
||||
iChartLegendHeight = 20 * {{ oUIBlock.iNbLinesToAddForName }} ,
|
||||
iChartTotalHeight = (iChartDefaultHeight+iChartLegendHeight);
|
||||
$('#my_chart_{{ oUIBlock.sId }}').height(iChartTotalHeight+'px');
|
||||
|
||||
var chart = c3.generate({
|
||||
bindto: d3.select('#my_chart_{{ oUIBlock.sId }}'),
|
||||
data: {
|
||||
@@ -9,7 +15,7 @@ var chart = c3.generate({
|
||||
names: {{ oUIBlock.sJSNames|raw }},
|
||||
onclick: function (d) {
|
||||
var aURLs = {{ oUIBlock.sJSURLs|raw }};
|
||||
window.location.href= aURLs[d.index];
|
||||
window.location.href = aURLs[d.index];
|
||||
},
|
||||
order: null
|
||||
},
|
||||
@@ -19,17 +25,19 @@ var chart = c3.generate({
|
||||
},
|
||||
tooltip: {
|
||||
format: {
|
||||
value: function (value) { return value; }
|
||||
value: function (value) {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
if (typeof(charts) === "undefined")
|
||||
if (typeof (charts) === "undefined")
|
||||
{
|
||||
charts = [];
|
||||
refreshChart = [];
|
||||
refreshChart = [];
|
||||
}
|
||||
var idxChart=charts.length;
|
||||
var idxChart = charts.length;
|
||||
charts.push(chart);
|
||||
var refreshChart{{ oUIBlock.sId|sanitize(constant('utils::ENUM_SANITIZATION_FILTER_VARIABLE_NAME')) }}=' $.post("{{ oUIBlock.sURLForRefresh|raw }}&refresh='+idxChart+'","", function (data) {'+
|
||||
'charts['+idxChart+'].unload();'+
|
||||
|
||||
Reference in New Issue
Block a user