Skip to content

Commit 0750bf6

Browse files
committed
feat: spaceTop/spaceBottom for data sets
1 parent 626b5fa commit 0750bf6

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

src/ui-chart/data/BaseDataSet.ts

+10
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,16 @@ export abstract class BaseDataSet<T extends Entry> implements IDataSet<T> {
123123
*/
124124
visible = true;
125125

126+
/**
127+
* data space from the smallest value to the bottom in percent of the total axis range
128+
*/
129+
spaceBottom = 0;
130+
131+
/**
132+
* data space from the highest value to the top in percent of the total axis range
133+
*/
134+
spaceTop = 0;
135+
126136
/**
127137
* Constructor with label.
128138
*

src/ui-chart/data/DataSet.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -178,11 +178,11 @@ export abstract class DataSet<T extends Entry> extends BaseDataSet<T> {
178178
}
179179

180180
public get yMin() {
181-
return this.mYMin;
181+
return this.mYMin - this.spaceBottom;
182182
}
183183

184184
public get yMax() {
185-
return this.mYMax;
185+
return this.mYMax + this.spaceTop;
186186
}
187187

188188
public get xMin() {

0 commit comments

Comments
 (0)