@@ -174,24 +174,35 @@ class Chart {
174174
175175 config = initConfig ( config ) ;
176176 const initialCanvas = getCanvas ( item ) ;
177- me . _initializePlatform ( initialCanvas , config ) ;
177+ this . platform = me . _initializePlatform ( initialCanvas , config ) ;
178178
179179 const context = me . platform . acquireContext ( initialCanvas , config ) ;
180180 const canvas = context && context . canvas ;
181181 const height = canvas && canvas . height ;
182182 const width = canvas && canvas . width ;
183183
184- me . id = helpers . uid ( ) ;
185- me . ctx = context ;
186- me . canvas = canvas ;
187- me . config = config ;
188- me . width = width ;
189- me . height = height ;
190- me . aspectRatio = height ? width / height : null ;
191- me . options = config . options ;
192- me . _bufferedRender = false ;
193- me . _layers = [ ] ;
194- me . _metasets = [ ] ;
184+ this . id = helpers . uid ( ) ;
185+ this . ctx = context ;
186+ this . canvas = canvas ;
187+ this . config = config ;
188+ this . width = width ;
189+ this . height = height ;
190+ this . aspectRatio = height ? width / height : null ;
191+ this . options = config . options ;
192+ this . _bufferedRender = false ;
193+ this . _layers = [ ] ;
194+ this . _metasets = [ ] ;
195+ this . boxes = [ ] ;
196+ this . currentDevicePixelRatio = undefined ;
197+ this . chartArea = undefined ;
198+ this . data = undefined ;
199+ this . active = undefined ;
200+ this . lastActive = undefined ;
201+ this . _lastEvent = undefined ;
202+ this . _listeners = { } ;
203+ this . _sortedMetasets = [ ] ;
204+ this . _updating = false ;
205+ this . scales = { } ;
195206
196207 // Add the chart instance to the global namespace
197208 Chart . instances [ me . id ] = me ;
@@ -250,17 +261,14 @@ class Chart {
250261 * @private
251262 */
252263 _initializePlatform ( canvas , config ) {
253- const me = this ;
254-
255264 if ( config . platform ) {
256- me . platform = new config . platform ( ) ;
265+ return new config . platform ( ) ;
257266 } else if ( ! isDomSupported ( ) ) {
258- me . platform = new BasicPlatform ( ) ;
267+ return new BasicPlatform ( ) ;
259268 } else if ( window . OffscreenCanvas && canvas instanceof window . OffscreenCanvas ) {
260- me . platform = new BasicPlatform ( ) ;
261- } else {
262- me . platform = new DomPlatform ( ) ;
269+ return new BasicPlatform ( ) ;
263270 }
271+ return new DomPlatform ( ) ;
264272 }
265273
266274 clear ( ) {
0 commit comments