Skip to content

Commit c0abe7b

Browse files
committed
fix: signature fixes
1 parent 4630f36 commit c0abe7b

File tree

4 files changed

+10
-6
lines changed

4 files changed

+10
-6
lines changed

src/charting/data/BaseDataSet.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { GradientColor } from '../model/GradientColor';
77
import { Color } from '@nativescript/core/color/color';
88
import { Utils } from '../utils/Utils';
99
import { Rounding } from './DataSet';
10+
import { IValueFormatter } from 'nativescript-chart/formatter/IValueFormatter';
1011

1112
/**
1213
* Created by Philipp Jahoda on 21/10/15.
@@ -74,7 +75,7 @@ export abstract class BaseDataSet<T extends Entry> implements IDataSet<T> {
7475
/**
7576
* custom formatter that is used instead of the auto-formatter if set
7677
*/
77-
protected mValueFormatter: ValueFormatter;
78+
protected mValueFormatter: IValueFormatter;
7879

7980
/**
8081
* the typeface used for the value text
@@ -270,7 +271,7 @@ export abstract class BaseDataSet<T extends Entry> implements IDataSet<T> {
270271
return this.mHighlightEnabled;
271272
}
272273

273-
public setValueFormatter(f) {
274+
public setValueFormatter(f: IValueFormatter) {
274275
if (f == null) return;
275276
else this.mValueFormatter = f;
276277
}

src/charting/data/ChartData.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { IDataSet } from '../interfaces/datasets/IDataSet';
22
import { Entry } from './Entry';
33
import { AxisDependency } from '../components/YAxis';
44
import { Highlight } from '../highlight/Highlight';
5+
import { IValueFormatter } from 'nativescript-chart/formatter/IValueFormatter';
56

67
export abstract class ChartData<U extends Entry, T extends IDataSet<U>> {
78
/**
@@ -587,7 +588,7 @@ export abstract class ChartData<U extends Entry, T extends IDataSet<U>> {
587588
*
588589
* @param f
589590
*/
590-
public setValueFormatter(f) {
591+
public setValueFormatter(f: IValueFormatter) {
591592
if (f == null) return;
592593
else {
593594
for (let set of this.mDataSets) {

src/charting/interfaces/datasets/IDataSet.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { LegendForm } from '../../components/Legend';
88
import { DashPathEffect } from 'nativescript-canvas';
99
import { Color } from '@nativescript/core/color/color';
1010
import { Font } from '@nativescript/core/ui/styling/font';
11+
import { IValueFormatter } from 'nativescript-chart/formatter/IValueFormatter';
1112

1213
/**
1314
* Created by Philipp Jahoda on 21/10/15.
@@ -320,14 +321,14 @@ export interface IDataSet<T extends Entry> {
320321
*
321322
* @param f
322323
*/
323-
setValueFormatter(f: ValueFormatter);
324+
setValueFormatter(f: IValueFormatter);
324325

325326
/**
326327
* Returns the formatter used for drawing the values inside the chart.
327328
*
328329
* @return
329330
*/
330-
getValueFormatter(): ValueFormatter;
331+
getValueFormatter(): IValueFormatter;
331332

332333
/**
333334
* Returns true if the valueFormatter object of this DataSet is null.

src/charting/utils/Utils.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { ValueFormatter } from '../formatter/ValueFormatter';
44
import { DefaultValueFormatter } from '../formatter/DefaultValueFormatter';
55
import { profile } from '@nativescript/core/profiling/profiling';
66
import { isAndroid } from '@nativescript/core/platform';
7+
import { IValueFormatter } from 'nativescript-chart/formatter/IValueFormatter';
78

89
export type FloatArray = Float32Array | Float64Array;
910
export let FloatConstructor: typeof Float32Array | typeof Float64Array;
@@ -157,7 +158,7 @@ export namespace Utils {
157158
*/
158159
const POW_10 = [1, 10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000, 1000000000];
159160

160-
let mDefaultValueFormatter: ValueFormatter = generateDefaultValueFormatter();
161+
let mDefaultValueFormatter: IValueFormatter = generateDefaultValueFormatter();
161162

162163
export function generateDefaultValueFormatter() {
163164
return new DefaultValueFormatter(1);

0 commit comments

Comments
 (0)