Skip to content

Commit d111ff4

Browse files
committed
fix: typings fix
1 parent e760f04 commit d111ff4

5 files changed

Lines changed: 10 additions & 16 deletions

File tree

src/ui-chart/data/BaseDataSet.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,11 @@ export abstract class BaseDataSet<T extends Entry> implements IDataSet<T> {
133133
*/
134134
spaceTop = 0;
135135

136+
/**
137+
* Ignore this dataSet to compute axis minMax
138+
*/
139+
ignoreForMinMax = false;
140+
136141
/**
137142
* Constructor with label.
138143
*

src/ui-chart/data/DataSet.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,6 @@ export abstract class DataSet<T extends Entry> extends BaseDataSet<T> {
358358
let closestYValue = this.getEntryYValue(Utils.getArrayItem(values, closest));
359359
let closestYIndex = closest;
360360

361-
// eslint-disable-next-line no-constant-condition
362361
while (true) {
363362
closest += 1;
364363
if (closest >= values.length) break;

src/ui-chart/interfaces/datasets/IDataSet.d.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,5 +388,4 @@ export interface IDataSet<T extends Entry> {
388388
* Ignore this dataSet to compute axis minMax
389389
*/
390390
ignoreForMinMax?: boolean;
391-
392391
}

src/ui-chart/renderer/LineChartRenderer.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -591,12 +591,11 @@ export class LineChartRenderer extends LineRadarRenderer {
591591
const maxEntryValue = dataSet.getEntryXValue(dataSet.getEntryForIndex(this.mXBounds.min + this.mXBounds.range), this.mXBounds.min + this.mXBounds.range);
592592

593593
const customRender = this.mChart.customRenderer;
594-
const drawFill = ()=>{
594+
const drawFill = () => {
595595
this.drawFill(c, dataSet, fillPath, trans, minEntryValue, maxEntryValue);
596-
597-
}
596+
};
598597
if (customRender?.drawFill) {
599-
customRender.drawFill(c, dataSet as LineDataSet, fillPath, trans, minEntryValue, maxEntryValue, drawFill);
598+
customRender.drawFill(c, dataSet, fillPath, trans, minEntryValue, maxEntryValue, drawFill);
600599
} else {
601600
drawFill();
602601
}
@@ -637,8 +636,6 @@ export class LineChartRenderer extends LineRadarRenderer {
637636
}
638637

639638
protected drawFill(c: Canvas, dataSet: ILineDataSet, spline: Path, trans: Transformer, min: number, max: number, color?, fillMin?: number) {
640-
641-
642639
const fillFormatter = dataSet.fillFormatter;
643640
if (fillFormatter.getFillLinePath) {
644641
fillFormatter.getFillLinePath(dataSet, this.mChart, spline, this.lastLinePath);

src/ui-chart/utils/Utils.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import { DefaultValueFormatter } from '../formatter/DefaultValueFormatter';
1515
import { ValueFormatter } from '../formatter/ValueFormatter';
1616
import { MPPointF } from './MPPointF';
1717
import { MPSize } from './MPSize';
18+
import { SDK_VERSION } from '@nativescript/core/utils';
1819

1920
export const ChartTraceCategory = 'NativescriptChart';
2021

@@ -29,13 +30,6 @@ export const CLog = (type: CLogTypes, ...args) => {
2930
Trace.write(args.map((a) => (a && typeof a === 'object' ? JSON.stringify(a) : a)).join(' '), ChartTraceCategory, type);
3031
};
3132

32-
let SDK_INT = -1;
33-
function getSDK() {
34-
if (SDK_INT === -1) {
35-
SDK_INT = android.os.Build.VERSION.SDK_INT;
36-
}
37-
return SDK_INT;
38-
}
3933
/**
4034
* Utilities class that has some helper methods. Needs to be initialized by
4135
* calling Utils.init(...) before usage. Inside the Chart.init() method, this is
@@ -633,7 +627,7 @@ export namespace Utils {
633627

634628
export function clipPathSupported() {
635629
if (__ANDROID__) {
636-
return getSDK() >= 18;
630+
return SDK_VERSION >= 18;
637631
}
638632
return true;
639633
}

0 commit comments

Comments
 (0)