Commit e0099876 authored by Elouan Le Bars's avatar Elouan Le Bars
Browse files

[UPD] tooltips on hovering detailled results

parent 3a051afc
...@@ -46,6 +46,13 @@ export default { ...@@ -46,6 +46,13 @@ export default {
legend: { legend: {
display: false, display: false,
}, },
hover: {
mode: 'nearest',
intersect: true
},
tooltips: {
mode: 'point',
},
scales: { scales: {
xAxes: [ xAxes: [
{ {
......
...@@ -6,11 +6,6 @@ Vue.use(Vuex); ...@@ -6,11 +6,6 @@ Vue.use(Vuex);
let labels = ["A", "B", "C"]; let labels = ["A", "B", "C"];
let labels_detailled = ["Scenario A", "Scenario B", "Scenario C"]; let labels_detailled = ["Scenario A", "Scenario B", "Scenario C"];
let backgroundColor = ["#e97272", "#e7dc73", "#83bdec"]; let backgroundColor = ["#e97272", "#e7dc73", "#83bdec"];
let hoverBackgroundColor = [
"rgba(0,0,0,0.8)",
"rgba(0,0,0,0.6)",
"rgba(0,0,0,0.3)",
];
const state = { const state = {
scenarios_json: [], scenarios_json: [],
...@@ -61,19 +56,16 @@ const state = { ...@@ -61,19 +56,16 @@ const state = {
label: "Matériel", label: "Matériel",
data: [0, 0, 0], data: [0, 0, 0],
backgroundColor, backgroundColor,
hoverBackgroundColor: hoverBackgroundColor[0],
}, },
{ {
label: "Réseau", label: "Réseau",
data: [0, 0, 0], data: [0, 0, 0],
backgroundColor, backgroundColor,
hoverBackgroundColor: hoverBackgroundColor[1],
}, },
{ {
label: "Trajets", label: "Trajets",
data: [0, 0, 0], data: [0, 0, 0],
backgroundColor, backgroundColor,
hoverBackgroundColor: hoverBackgroundColor[2],
}, },
], ],
}, },
...@@ -84,19 +76,16 @@ const state = { ...@@ -84,19 +76,16 @@ const state = {
label: "Matériel", label: "Matériel",
data: [0, 0, 0], data: [0, 0, 0],
backgroundColor, backgroundColor,
hoverBackgroundColor: hoverBackgroundColor[0],
}, },
{ {
label: "Réseau", label: "Réseau",
data: [0, 0, 0], data: [0, 0, 0],
backgroundColor, backgroundColor,
hoverBackgroundColor: hoverBackgroundColor[1],
}, },
{ {
label: "Trajets", label: "Trajets",
data: [0, 0, 0], data: [0, 0, 0],
backgroundColor, backgroundColor,
hoverBackgroundColor: hoverBackgroundColor[2],
}, },
], ],
}, },
...@@ -107,19 +96,16 @@ const state = { ...@@ -107,19 +96,16 @@ const state = {
label: "Matériel", label: "Matériel",
data: [0, 0, 0], data: [0, 0, 0],
backgroundColor, backgroundColor,
hoverBackgroundColor: hoverBackgroundColor[0],
}, },
{ {
label: "Réseau", label: "Réseau",
data: [0, 0, 0], data: [0, 0, 0],
backgroundColor, backgroundColor,
hoverBackgroundColor: hoverBackgroundColor[1],
}, },
{ {
label: "Trajets", label: "Trajets",
data: [0, 0, 0], data: [0, 0, 0],
backgroundColor, backgroundColor,
hoverBackgroundColor: hoverBackgroundColor[2],
}, },
], ],
}, },
...@@ -130,19 +116,16 @@ const state = { ...@@ -130,19 +116,16 @@ const state = {
label: "Matériel", label: "Matériel",
data: [0, 0, 0], data: [0, 0, 0],
backgroundColor, backgroundColor,
hoverBackgroundColor: hoverBackgroundColor[0],
}, },
{ {
label: "Réseau", label: "Réseau",
data: [0, 0, 0], data: [0, 0, 0],
backgroundColor, backgroundColor,
hoverBackgroundColor: hoverBackgroundColor[1],
}, },
{ {
label: "Trajets", label: "Trajets",
data: [0, 0, 0], data: [0, 0, 0],
backgroundColor, backgroundColor,
hoverBackgroundColor: hoverBackgroundColor[2],
}, },
], ],
}, },
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment