|
|
|
|
@ -87,6 +87,8 @@ export const PointChart = ({ point }) => {
|
|
|
|
|
},
|
|
|
|
|
tooltip: {
|
|
|
|
|
displayColors: false,
|
|
|
|
|
xAlign: "left",
|
|
|
|
|
yAlign: "bottom",
|
|
|
|
|
callbacks: {
|
|
|
|
|
label: function(context) {
|
|
|
|
|
const label = []
|
|
|
|
|
@ -96,9 +98,8 @@ export const PointChart = ({ point }) => {
|
|
|
|
|
if (context.parsed.x !== null) {
|
|
|
|
|
let labelText = "";
|
|
|
|
|
if (context.datasetIndex === 0) labelText = "Вклад в прогноз, %: ";
|
|
|
|
|
if (context.datasetIndex === 1) labelText = "Средний вклад в прогноз, %: ";
|
|
|
|
|
if (context.datasetIndex === 2) labelText = "Минимальный вклад в прогноз, %: ";
|
|
|
|
|
if (context.datasetIndex === 3) labelText = "Максимальный вклад в прогноз, %: ";
|
|
|
|
|
if (context.datasetIndex === 1) labelText = "Минимальный вклад в прогноз, %: ";
|
|
|
|
|
if (context.datasetIndex === 2) labelText = "Максимальный вклад в прогноз, %: ";
|
|
|
|
|
label.push(labelText + context.parsed.x);
|
|
|
|
|
}
|
|
|
|
|
return label;
|
|
|
|
|
@ -107,25 +108,21 @@ export const PointChart = ({ point }) => {
|
|
|
|
|
return "Вклад в прогноз, %:"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
scales: {
|
|
|
|
|
y: {
|
|
|
|
|
stacked: true,
|
|
|
|
|
},
|
|
|
|
|
x: {
|
|
|
|
|
title: {
|
|
|
|
|
display: true,
|
|
|
|
|
text: 'Вклад в прогноз, %'
|
|
|
|
|
text: 'Вклад в прогноз, %',
|
|
|
|
|
},
|
|
|
|
|
grid: {
|
|
|
|
|
lineWidth: function(context) {
|
|
|
|
|
if (context.tick.value === 0) {
|
|
|
|
|
return 3;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
|
},
|
|
|
|
|
color: function(context) {
|
|
|
|
|
if (context.tick.value === 0) {
|
|
|
|
|
return "#AAAAAA";
|
|
|
|
|
return "#000000";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return "#E5E5E5";
|
|
|
|
|
@ -150,32 +147,20 @@ export const PointChart = ({ point }) => {
|
|
|
|
|
type: 'line',
|
|
|
|
|
showLine: false,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
data: labels.map((l) => meanData ? meanData[`avg_${l}`] : 0),
|
|
|
|
|
backgroundColor: "#CCCCCCCC",
|
|
|
|
|
hoverBackgroundColor: "#BBBBBBCC",
|
|
|
|
|
type: 'bar',
|
|
|
|
|
showLine: false
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
data: labels.map((l) => meanData ? meanData[`min_${l}`] : 0),
|
|
|
|
|
type: 'line',
|
|
|
|
|
backgroundColor: "#cccccc",
|
|
|
|
|
hoverBackgroundColor: "#aaaaaa",
|
|
|
|
|
type: 'bar',
|
|
|
|
|
showLine: false,
|
|
|
|
|
pointStyle: 'line',
|
|
|
|
|
pointBorderColor: "#888888",
|
|
|
|
|
pointRadius: 10,
|
|
|
|
|
pointHoverRadius: 10,
|
|
|
|
|
pointRotation: 90
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
data: labels.map((l) => meanData ? meanData[`max_${l}`] : 0),
|
|
|
|
|
type: 'line',
|
|
|
|
|
backgroundColor: "#cccccc",
|
|
|
|
|
|
|
|
|
|
hoverBackgroundColor: "#aaaaaa",
|
|
|
|
|
type: 'bar',
|
|
|
|
|
showLine: false,
|
|
|
|
|
pointStyle: 'line',
|
|
|
|
|
pointBorderColor: "#888888",
|
|
|
|
|
pointRadius: 10,
|
|
|
|
|
pointHoverRadius: 10,
|
|
|
|
|
pointRotation: 90
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
};
|
|
|
|
|
|