1
1
import { Canvas , Matrix , Paint , RectF , Style } from '@nativescript-community/ui-canvas' ;
2
- import { EventData , Observable , profile } from '@nativescript/core' ;
2
+ import { EventData , Observable , Trace , profile } from '@nativescript/core' ;
3
3
import { getEventOrGestureName } from '@nativescript/core/ui/core/bindable' ;
4
4
import { GestureTypes } from '@nativescript/core/ui/gestures' ;
5
5
import { LegendHorizontalAlignment , LegendOrientation , LegendVerticalAlignment } from '../components/Legend' ;
@@ -18,7 +18,7 @@ import { BarLineChartTouchListener } from '../listener/BarLineChartTouchListener
18
18
import { XAxisRenderer } from '../renderer/XAxisRenderer' ;
19
19
import { YAxisRenderer } from '../renderer/YAxisRenderer' ;
20
20
import { Transformer } from '../utils/Transformer' ;
21
- import { Utils } from '../utils/Utils' ;
21
+ import { CLog , CLogTypes , Utils } from '../utils/Utils' ;
22
22
import { Chart } from './Chart' ;
23
23
24
24
const LOG_TAG = 'BarLineChartBase' ;
@@ -263,12 +263,12 @@ export abstract class BarLineChartBase<U extends Entry, D extends IBarLineScatte
263
263
this . drawMarkers ( canvas ) ;
264
264
265
265
this . notify ( { eventName : 'drawn' , object : this } ) ;
266
- if ( this . mLogEnabled ) {
266
+ if ( Trace . isEnabled ( ) ) {
267
267
const drawtime = Date . now ( ) - startTime ;
268
268
this . totalTime += drawtime ;
269
269
this . drawCycles += 1 ;
270
270
const average = this . totalTime / this . drawCycles ;
271
- console . log ( this . constructor . name , 'Drawtime: ' + drawtime + ' ms, average: ' + average + ' ms, cycles: ' + this . drawCycles ) ;
271
+ CLog ( CLogTypes . log , this . constructor . name , 'Drawtime: ' + drawtime + ' ms, average: ' + average + ' ms, cycles: ' + this . drawCycles ) ;
272
272
}
273
273
}
274
274
@@ -281,8 +281,8 @@ export abstract class BarLineChartBase<U extends Entry, D extends IBarLineScatte
281
281
}
282
282
283
283
protected prepareValuePxMatrix ( ) {
284
- if ( this . mLogEnabled ) {
285
- console . log ( LOG_TAG , 'Preparing Value-Px Matrix, xmin: ' + this . mXAxis . mAxisMinimum + ', xmax: ' + this . mXAxis . mAxisMaximum + ', xdelta: ' + this . mXAxis . mAxisRange ) ;
284
+ if ( Trace . isEnabled ( ) ) {
285
+ CLog ( CLogTypes . info , LOG_TAG , 'Preparing Value-Px Matrix, xmin: ' + this . mXAxis . mAxisMinimum + ', xmax: ' + this . mXAxis . mAxisMaximum + ', xdelta: ' + this . mXAxis . mAxisRange ) ;
286
286
}
287
287
if ( this . mAxisRight . isEnabled ( ) ) {
288
288
this . mRightAxisTransformer . prepareMatrixValuePx ( this . mXAxis . mAxisMinimum , this . mXAxis . mAxisRange , this . mAxisRight . mAxisRange , this . mAxisRight . mAxisMinimum ) ;
@@ -303,18 +303,18 @@ export abstract class BarLineChartBase<U extends Entry, D extends IBarLineScatte
303
303
304
304
public notifyDataSetChanged ( ) {
305
305
if ( this . mData == null ) {
306
- if ( this . mLogEnabled ) {
307
- console . log ( LOG_TAG , 'Preparing... DATA NOT SET.' ) ;
306
+ if ( Trace . isEnabled ( ) ) {
307
+ CLog ( CLogTypes . info , LOG_TAG , 'Preparing... DATA NOT SET.' ) ;
308
308
}
309
309
return ;
310
310
} else if ( ! this . mViewPortHandler . hasChartDimens ( ) ) {
311
- if ( this . mLogEnabled ) {
312
- console . log ( LOG_TAG , 'Preparing... NOT SIZED YET.' ) ;
311
+ if ( Trace . isEnabled ( ) ) {
312
+ CLog ( CLogTypes . info , LOG_TAG , 'Preparing... NOT SIZED YET.' ) ;
313
313
}
314
314
return ;
315
315
} else {
316
- if ( this . mLogEnabled ) {
317
- console . log ( LOG_TAG , 'Preparing...' ) ;
316
+ if ( Trace . isEnabled ( ) ) {
317
+ CLog ( CLogTypes . info , LOG_TAG , 'Preparing...' ) ;
318
318
}
319
319
}
320
320
@@ -480,8 +480,8 @@ export abstract class BarLineChartBase<U extends Entry, D extends IBarLineScatte
480
480
481
481
this . mViewPortHandler . restrainViewPort ( Math . max ( minOffset , offsetLeft ) , Math . max ( minOffset , offsetTop ) , Math . max ( minOffset , offsetRight ) , Math . max ( minOffset , offsetBottom ) ) ;
482
482
483
- if ( this . mLogEnabled ) {
484
- console . log ( LOG_TAG , 'offsetLeft: ' + offsetLeft + ', offsetTop: ' + offsetTop + ', offsetRight: ' + offsetRight + ', offsetBottom: ' + offsetBottom ) ;
483
+ if ( Trace . isEnabled ( ) ) {
484
+ CLog ( CLogTypes . info , LOG_TAG , 'offsetLeft: ' + offsetLeft + ', offsetTop: ' + offsetTop + ', offsetRight: ' + offsetRight + ', offsetBottom: ' + offsetBottom ) ;
485
485
console . log ( LOG_TAG , 'Content: ' + this . mViewPortHandler . getContentRect ( ) . toString ( ) ) ;
486
486
}
487
487
}
0 commit comments