import { CLINICAL_THRESHOLDS } from '../pkCore.js'; export function createChartAnnotations(mode) { const thresholds = CLINICAL_THRESHOLDS[mode]; const annotations = {}; thresholds.zones.forEach((zone, index) => { // Évite d'étendre la dernière zone à l'infini sur le graphe const yMax = zone.max === Infinity ? thresholds.maxScale : zone.max; if (zone.min < thresholds.maxScale) { annotations[`zone_${index}`] = { type: 'box', yMin: zone.min, yMax: Math.min(yMax, thresholds.maxScale), backgroundColor: zone.color, borderWidth: 0, label: { display: true, content: zone.name, color: zone.textHex, font: { size: 14, weight: 'bold' }, position: 'center' } }; } }); return annotations; }