Bili chart: shorter labels + wider right padding to stop clipping
Replaced "Phototherapy" with the clinical abbreviation "Photo Tx"
(fits in the right margin without cut-off). Exchange label stays.
Bumped the layout right-padding from 40 px to 88 px so even the
longest label ("95th (High-Risk)" on the Bhutani chart) prints
fully inside the canvas on narrow viewports.
This commit is contained in:
parent
d192f34198
commit
b49532d293
1 changed files with 5 additions and 5 deletions
|
|
@ -1510,8 +1510,9 @@
|
||||||
aspectRatio: 1.6,
|
aspectRatio: 1.6,
|
||||||
animation: { duration: 300 },
|
animation: { duration: 300 },
|
||||||
// Extra right padding so the threshold labels drawn past the
|
// Extra right padding so the threshold labels drawn past the
|
||||||
// last data point stay inside the canvas.
|
// last data point stay inside the canvas. 88 px fits the
|
||||||
layout: { padding: { right: 40 } },
|
// longest current label ("95th (High-Risk)") in 11 px bold.
|
||||||
|
layout: { padding: { right: 88 } },
|
||||||
scales: {
|
scales: {
|
||||||
x: {
|
x: {
|
||||||
type: 'linear',
|
type: 'linear',
|
||||||
|
|
@ -1645,9 +1646,9 @@
|
||||||
// - Dashed crimson exchange line above (danger threshold)
|
// - Dashed crimson exchange line above (danger threshold)
|
||||||
var chartDatasets = [
|
var chartDatasets = [
|
||||||
{
|
{
|
||||||
label: 'Phototherapy',
|
label: 'Photo Tx', // shortened from "Phototherapy"
|
||||||
data: generateThresholdCurve(table),
|
data: generateThresholdCurve(table),
|
||||||
borderColor: '#f97316', // orange line
|
borderColor: '#f97316', // orange line
|
||||||
borderWidth: 2.4,
|
borderWidth: 2.4,
|
||||||
borderDash: [],
|
borderDash: [],
|
||||||
fill: 'origin',
|
fill: 'origin',
|
||||||
|
|
@ -1661,7 +1662,6 @@
|
||||||
borderColor: '#b91c1c', // crimson line
|
borderColor: '#b91c1c', // crimson line
|
||||||
borderWidth: 2.4,
|
borderWidth: 2.4,
|
||||||
borderDash: [6, 3],
|
borderDash: [6, 3],
|
||||||
// Fill between this line and the phototherapy line (dataset 0)
|
|
||||||
fill: { target: 0 },
|
fill: { target: 0 },
|
||||||
backgroundColor: 'rgba(252,211,77,0.22)' // amber band = "treat"
|
backgroundColor: 'rgba(252,211,77,0.22)' // amber band = "treat"
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue