1
1
'use strict' ;
2
2
3
- import * as Chart from 'chart.js' ;
3
+ import { helpers , defaults , pluginService } from 'chart.js' ;
4
4
import { toNodes , countExpanded , resolve , parentsOf , preOrderTraversal , lastOfLevel , spanLogic } from '../utils' ;
5
5
6
6
7
7
function parseFontOptions ( options ) {
8
- const valueOrDefault = Chart . helpers . valueOrDefault ;
9
- const globalDefaults = Chart . defaults . global ;
8
+ const valueOrDefault = helpers . valueOrDefault ;
9
+ const globalDefaults = defaults . global ;
10
10
const size = valueOrDefault ( options . fontSize , globalDefaults . defaultFontSize ) ;
11
11
const style = valueOrDefault ( options . fontStyle , globalDefaults . defaultFontStyle ) ;
12
12
const family = valueOrDefault ( options . fontFamily , globalDefaults . defaultFontFamily ) ;
@@ -15,7 +15,7 @@ function parseFontOptions(options) {
15
15
size : size ,
16
16
style : style ,
17
17
family : family ,
18
- font : Chart . helpers . fontString ( size , style , family )
18
+ font : helpers . fontString ( size , style , family )
19
19
} ;
20
20
}
21
21
@@ -156,7 +156,7 @@ const HierarchicalPlugin = {
156
156
const renderLabel = scale . options . hierarchyLabelPosition ;
157
157
158
158
const scaleLabel = scale . options . scaleLabel ;
159
- const scaleLabelFontColor = Chart . helpers . valueOrDefault ( scaleLabel . fontColor , Chart . defaults . global . defaultFontColor ) ;
159
+ const scaleLabelFontColor = helpers . valueOrDefault ( scaleLabel . fontColor , defaults . global . defaultFontColor ) ;
160
160
const scaleLabelFont = parseFontOptions ( scaleLabel ) ;
161
161
162
162
ctx . save ( ) ;
@@ -488,6 +488,6 @@ const HierarchicalPlugin = {
488
488
}
489
489
} ;
490
490
491
- Chart . pluginService . register ( HierarchicalPlugin ) ;
491
+ pluginService . register ( HierarchicalPlugin ) ;
492
492
493
493
export default HierarchicalPlugin ;
0 commit comments