Renamed metric menu item from Categorie to Type.

This commit is contained in:
Christian P. MOMON 2021-05-26 00:27:14 +02:00
parent b9f3d6b600
commit 65c359cfb8
3 changed files with 28 additions and 26 deletions

View file

@ -60,26 +60,26 @@ public class ServiceMetricMenuView
{ {
TagDataManager data = new TagDataManager(); TagDataManager data = new TagDataManager();
data.setAttribute("summaryCategoryButton", "href", service.getOrganization().getTechnicalName() + "-" + service.getTechnicalName() + ".xhtml"); data.setAttribute("summaryTypeButton", "href", service.getOrganization().getTechnicalName() + "-" + service.getTechnicalName() + ".xhtml");
data.setAttribute("genericCategoryButton", "href", service.getOrganization().getTechnicalName() + "-" + service.getTechnicalName() + "-metrics-generic.xhtml"); data.setAttribute("genericTypeButton", "href", service.getOrganization().getTechnicalName() + "-" + service.getTechnicalName() + "-metrics-generic.xhtml");
data.setAttribute("webCategoryButton", "href", service.getOrganization().getTechnicalName() + "-" + service.getTechnicalName() + "-metrics-web.xhtml"); data.setAttribute("webTypeButton", "href", service.getOrganization().getTechnicalName() + "-" + service.getTechnicalName() + "-metrics-web.xhtml");
data.setAttribute("specificCategoryButton", "href", service.getOrganization().getTechnicalName() + "-" + service.getTechnicalName() + "-metrics-specific.xhtml"); data.setAttribute("specificTypeButton", "href", service.getOrganization().getTechnicalName() + "-" + service.getTechnicalName() + "-metrics-specific.xhtml");
if ((item == null) || (item == MenuItem.SUMMARY)) if ((item == null) || (item == MenuItem.SUMMARY))
{ {
data.appendAttribute("summaryCategoryButton", "class", "button selected"); data.appendAttribute("summaryTypeButton", "class", "button selected");
} }
else if (item == MenuItem.GENERIC) else if (item == MenuItem.GENERIC)
{ {
data.appendAttribute("genericCategoryButton", "class", "button selected"); data.appendAttribute("genericTypeButton", "class", "button selected");
} }
else if (item == MenuItem.WEB) else if (item == MenuItem.WEB)
{ {
data.appendAttribute("webCategoryButton", "class", "button selected"); data.appendAttribute("webTypeButton", "class", "button selected");
} }
else if (item == MenuItem.SPECIFIC) else if (item == MenuItem.SPECIFIC)
{ {
data.appendAttribute("specificCategoryButton", "class", "button selected"); data.appendAttribute("specificTypeButton", "class", "button selected");
} }
// //

View file

@ -19,7 +19,7 @@
var ctx = document.getElementById('myChart'); var ctx = document.getElementById('myChart');
var myChart = new Chart(ctx, var myChart = new Chart(ctx,
{ {
type: 'line', type: 'bar',
data: data:
{ {
datasets: datasets:
@ -44,7 +44,7 @@
fill: true, fill: true,
lineTension: 0, lineTension: 0,
pointBorderWidth: 0.00000001, pointBorderWidth: 0.00000001,
data: [1, 5, 9, 13, 15, 22] data: [{t: '2020-01', y: 7},{t: '2020-02', y: 9},{t: '2020-03', y: 4},{t: '2020-04', y: 2},{t: '2020-05', y: 1},{t: '2020-06', y: 7},{t: '2020-07', y: 0},{t: '2020-08', y: 0},{t: '2020-09', y: 0},{t: '2020-10', y: 0},{t: '2020-11', y: 0},{t: '2020-12', y: 0}]
} }
] ]
}, },
@ -75,10 +75,11 @@
beginAtZero: false, beginAtZero: false,
maxTicksLimit: 0 maxTicksLimit: 0
}, },
stacked: true,
gridLines: gridLines:
{ {
zeroLineColor: 'rgba(0, 0, 0, 0.1)', zeroLineColor: 'rgba(0, 0, 0, 0.1)',
offsetGridLines: false offsetGridLines: true
} }
}], }],
yAxes: yAxes:
@ -88,7 +89,8 @@
beginAtZero: false, beginAtZero: false,
suggestedMax: 10, suggestedMax: 10,
precision: 0 precision: 0
} },
stacked: true,
}] }]
} }
} }

View file

@ -13,11 +13,11 @@
<body> <body>
<div> <div>
<div style="margin: 5px;"> <div style="margin: 5px;">
<span style="display: inline-block; width: 100px">Catégorie</span> <span style="display: inline-block; width: 100px">Type</span>
<a onclick="javascript:selectCategoryMenu('summary');" href="#" id="summaryCategoryButton" class="button">Résumé</a> <a onclick="javascript:selectTypeMenu('summary');" href="#" id="summaryTypeButton" class="button">Résumé</a>
<a onclick="javascript:selectCategoryMenu('generic');" href="#" id="genericCategoryButton" class="button">Génériques</a> <a onclick="javascript:selectTypeMenu('generic');" href="#" id="genericTypeButton" class="button">Génériques</a>
<a onclick="javascript:selectCategoryMenu('web');" href="#" id="webCategoryButton" class="button">Web</a> <a onclick="javascript:selectTypeMenu('web');" href="#" id="webTypeButton" class="button">Web</a>
<a onclick="javascript:selectCategoryMenu('specific');" href="#" id="specificCategoryButton" class="button">Spécifiques</a> <a onclick="javascript:selectTypeMenu('specific');" href="#" id="specificTypeButton" class="button">Spécifiques</a>
</div> </div>
<div style="margin: 5px;"> <div style="margin: 5px;">
<span style="display: inline-block; width: 100px">Période</span> <span style="display: inline-block; width: 100px">Période</span>
@ -36,28 +36,28 @@
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
function selectCategoryMenu(selection) function selectTypeMenu(selection)
{ {
document.getElementById ('summaryCategoryButton').classList.remove('selected'); document.getElementById ('summaryTypeButton').classList.remove('selected');
document.getElementById ('genericCategoryButton').classList.remove('selected'); document.getElementById ('genericTypeButton').classList.remove('selected');
document.getElementById ('webCategoryButton').classList.remove('selected'); document.getElementById ('webTypeButton').classList.remove('selected');
document.getElementById ('specificCategoryButton').classList.remove('selected'); document.getElementById ('specificTypeButton').classList.remove('selected');
if (selection == 'summary') if (selection == 'summary')
{ {
document.getElementById ('summaryCategoryButton').classList.add('selected'); document.getElementById ('summaryTypeButton').classList.add('selected');
} }
else if (selection == 'generic') else if (selection == 'generic')
{ {
document.getElementById ('genericCategoryButton').classList.add('selected'); document.getElementById ('genericTypeButton').classList.add('selected');
} }
else if (selection == 'web') else if (selection == 'web')
{ {
document.getElementById ('webCategoryButton').classList.add('selected'); document.getElementById ('webTypeButton').classList.add('selected');
} }
else if (selection == 'specific') else if (selection == 'specific')
{ {
document.getElementById ('specificCategoryButton').classList.add('selected'); document.getElementById ('specificTypeButton').classList.add('selected');
} }
} }