Skip to content

Commit 32e1b45

Browse files
authored
Fix font type definition to be partial (#849)
1 parent cb5cb23 commit 32e1b45

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

types/label.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export interface CalloutOptions {
3939

4040
export interface CoreLabelOptions {
4141
drawTime?: Scriptable<DrawTime, PartialEventContext>,
42-
font?: FontSpec
42+
font?: Scriptable<Partial<FontSpec>, PartialEventContext>,
4343
color?: Scriptable<Color, PartialEventContext>,
4444
/**
4545
* Padding of label

types/tests/exports.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,17 @@ const chart = new Chart('id', {
2525
drawTime: 'afterDraw',
2626
borderColor: 'red',
2727
label: {
28-
display: true
28+
display: true,
29+
font: (ctx) => ({ size: 10 })
2930
}
3031
},
3132
annotations: [{
3233
type: 'line',
3334
label: {
34-
content: ['test', 'multiple']
35+
content: ['test', 'multiple'],
36+
font: {
37+
size: 10
38+
}
3539
}
3640
}, {
3741
type: 'box',

0 commit comments

Comments
 (0)