Improve graph data point display

This commit is contained in:
Joshua Boniface 2025-02-26 23:52:05 -05:00
parent bc1ca6d8ab
commit 18a32315ea
2 changed files with 13 additions and 10 deletions

View File

@ -172,8 +172,6 @@ const getDeltaClass = (delta) => {
};
const healthChartData = computed(() => {
const health = props.clusterData.cluster_health?.health || 0;
return {
labels: props.metricsHistory.labels,
datasets: [{
@ -195,13 +193,17 @@ const healthChartData = computed(() => {
},
borderWidth: 1.5,
tension: 0.4,
pointRadius: 2,
pointBackgroundColor: (ctx) => {
const value = ctx.parsed.y;
if (value > 90) return 'rgba(40, 167, 69, 0.2)'; // Green
if (value > 50) return 'rgba(255, 193, 7, 0.2)'; // Yellow
return 'rgba(220, 53, 69, 0.2)'; // Red
}
pointRadius: 0,
pointHoverRadius: 4,
pointBackgroundColor: 'rgba(255, 255, 255, 0.8)', // Light background for all points
pointBorderColor: (ctx) => {
if (!ctx.raw) return 'rgba(0, 0, 0, 0.2)';
const value = ctx.raw;
if (value > 90) return 'rgba(40, 167, 69, 0.5)'; // Green
if (value > 50) return 'rgba(255, 193, 7, 0.5)'; // Yellow
return 'rgba(220, 53, 69, 0.5)'; // Red
},
pointBorderWidth: 1.5
}]
};
});

View File

@ -117,7 +117,8 @@ const chartOptions = {
tension: 0.2
},
point: {
radius: 2
radius: 0,
hoverRadius: 4
}
},
plugins: {