Skip to content

Commit d0e2fed

Browse files
committed
Sync LineOptions/DataSet#stepped and tension
Fixes #262
1 parent 50e8e24 commit d0e2fed

File tree

3 files changed

+47
-3
lines changed

3 files changed

+47
-3
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 2.3.1
2+
* Synced ``LineOptions/DataSet`` ``stepped`` and ``tension`` with ChartJS source #262
3+
* Updated dependencies
4+
15
## 2.3.0
26
* Update available datasets fields from ChartJS source code #244
37
* Removed deprecated code

chartjs-java-model/src/main/java/software/xdev/chartjs/model/dataset/LineDatasetBase.java

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ public abstract class LineDatasetBase<T extends PointDataset<T, O>, O> extends P
3232

3333
private final List<Integer> pointHitRadius = new OptionalArray<>();
3434

35-
private Boolean stepped;
35+
protected Number tension;
36+
protected Object stepped;
3637

3738
public String getXAxisID()
3839
{
@@ -78,12 +79,23 @@ public T setSpanGaps(final Object spanGaps)
7879
return this.self();
7980
}
8081

81-
public Boolean getStepped()
82+
public Number getTension()
83+
{
84+
return this.tension;
85+
}
86+
87+
public T setTension(final Number tension)
88+
{
89+
this.tension = tension;
90+
return this.self();
91+
}
92+
93+
public Object getStepped()
8294
{
8395
return this.stepped;
8496
}
8597

86-
public T setStepped(final Boolean stepped)
98+
public T setStepped(final Object stepped)
8799
{
88100
this.stepped = stepped;
89101
return this.self();

chartjs-java-model/src/main/java/software/xdev/chartjs/model/options/LineOptions.java

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,14 @@
1919
import software.xdev.chartjs.model.options.elements.LineElements;
2020

2121

22+
/**
23+
* @see <a href="https://github.com/chartjs/Chart.js/blob/v4.4.5/src/types/index.d.ts#L1892">ChartJS Source</a>
24+
*/
2225
public class LineOptions extends Options<LineOptions, DefaultAnimation>
2326
{
27+
protected Number tension;
28+
protected Object stepped;
29+
2430
/**
2531
* @see #setShowLine(Boolean)
2632
*/
@@ -31,6 +37,28 @@ public class LineOptions extends Options<LineOptions, DefaultAnimation>
3137
protected Boolean spanGaps;
3238
protected LineElements elements;
3339

40+
public Number getTension()
41+
{
42+
return this.tension;
43+
}
44+
45+
public LineOptions setTension(final Number tension)
46+
{
47+
this.tension = tension;
48+
return this;
49+
}
50+
51+
public Object getStepped()
52+
{
53+
return this.stepped;
54+
}
55+
56+
public LineOptions setStepped(final Object stepped)
57+
{
58+
this.stepped = stepped;
59+
return this;
60+
}
61+
3462
/**
3563
* @see #setShowLine(Boolean)
3664
*/

0 commit comments

Comments
 (0)