Skip to content

Commit 66f51e6

Browse files
authored
Merge pull request #245 from xdev-software/develop
Release
2 parents 46412b3 + bdd0d18 commit 66f51e6

24 files changed

+412
-190
lines changed

Diff for: .github/workflows/sonar.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111
- '.idea/**'
1212
- 'assets/**'
1313
pull_request:
14-
types: [opened, synchronize, reopened]
14+
branches: [ develop ]
1515
paths-ignore:
1616
- '**.md'
1717
- '.config/**'

Diff for: CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 2.3.0
2+
* Update available datasets fields from ChartJS source code #244
3+
* Removed deprecated code
4+
15
## 2.2.0
26
* Improve color handling #238
37
* Change ``Color`` to ``RGBAColor`` as it only handles RGBA

Diff for: LICENSE

+1
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@
187187
identification within third-party archives.
188188

189189
Copyright 2024 XDEV Software
190+
Copyright 2020 Marceau Dewilde
190191

191192
Licensed under the Apache License, Version 2.0 (the "License");
192193
you may not use this file except in compliance with the License.

Diff for: chartjs-java-model-demo/pom.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
<parent>
88
<groupId>software.xdev</groupId>
99
<artifactId>chartjs-java-model-root</artifactId>
10-
<version>2.2.1-SNAPSHOT</version>
10+
<version>2.3.0-SNAPSHOT</version>
1111
</parent>
1212

1313
<artifactId>chartjs-java-model-demo</artifactId>
14-
<version>2.2.1-SNAPSHOT</version>
14+
<version>2.3.0-SNAPSHOT</version>
1515
<packaging>jar</packaging>
1616

1717
<organization>

Diff for: chartjs-java-model/pom.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>software.xdev</groupId>
88
<artifactId>chartjs-java-model</artifactId>
9-
<version>2.2.1-SNAPSHOT</version>
9+
<version>2.3.0-SNAPSHOT</version>
1010
<packaging>jar</packaging>
1111

1212
<name>chartjs-java-model</name>
@@ -49,7 +49,7 @@
4949
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
5050

5151
<slf4j-version>2.0.16</slf4j-version>
52-
<log4j-version>2.23.1</log4j-version>
52+
<log4j-version>2.24.0</log4j-version>
5353
<testcontainers-version>1.20.1</testcontainers-version>
5454

5555
<!-- by default run no tests as Docker is required -->

Diff for: chartjs-java-model/src/main/java/software/xdev/chartjs/model/charts/Chart.java

-18
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,6 @@ public interface Chart<SELF, O extends Options<?, ?>, D extends AbstractData<?,
3030
@JsonProperty("type")
3131
String getType();
3232

33-
/**
34-
* @deprecated As of 2.1.0 {@link #toJson()} has the same functionality and should be used instead
35-
*/
36-
@Deprecated(since = "2.1.0", forRemoval = true)
37-
default String toJsonNative()
38-
{
39-
return this.toJson();
40-
}
41-
4233
/**
4334
* <p>
4435
* Convert {@code this} instance to Json for use with Chart.js library.
@@ -48,15 +39,6 @@ default String toJsonNative()
4839
*/
4940
String toJson();
5041

51-
/**
52-
* @deprecated No functionality implemented as of 2.1.0
53-
*/
54-
@Deprecated(since = "2.1.0", forRemoval = true)
55-
default boolean isDrawable()
56-
{
57-
return true;
58-
}
59-
6042
SELF setOptions(final O options);
6143

6244
SELF setData(final D data);

Diff for: chartjs-java-model/src/main/java/software/xdev/chartjs/model/dataset/BackgroundBorderHoverDataset.java

-5
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,10 @@ public abstract class BackgroundBorderHoverDataset<T extends BackgroundBorderHov
2525
extends Dataset<T, O>
2626
{
2727
protected final List<Object> backgroundColor = new OptionalArray<>();
28-
2928
protected final List<Object> borderColor = new OptionalArray<>();
30-
3129
protected final List<Integer> borderWidth = new OptionalArray<>();
32-
3330
protected final List<Object> hoverBackgroundColor = new OptionalArray<>();
34-
3531
protected final List<Object> hoverBorderColor = new OptionalArray<>();
36-
3732
protected final List<Integer> hoverBorderWidth = new OptionalArray<>();
3833

3934
public List<Object> getBackgroundColor()

Diff for: chartjs-java-model/src/main/java/software/xdev/chartjs/model/dataset/BarDataset.java

+92-27
Original file line numberDiff line numberDiff line change
@@ -18,35 +18,34 @@
1818
import java.util.List;
1919

2020
import software.xdev.chartjs.model.enums.BorderSkipped;
21+
import software.xdev.chartjs.model.enums.PointStyle;
2122
import software.xdev.chartjs.model.objects.OptionalArray;
2223

2324

25+
/**
26+
* @see <a href="https://github.com/chartjs/Chart.js/blob/v4.4.4/src/types/index.d.ts#L114">ChartJS Source</a>
27+
*/
2428
public class BarDataset extends BackgroundBorderHoverDataset<BarDataset, Number>
2529
implements NumberDataset<BarDataset>
2630
{
27-
private String label;
28-
private String xAxisID;
29-
private String yAxisID;
30-
private final List<BorderSkipped> borderSkipped = new OptionalArray<>();
31-
private String stack;
31+
protected String xAxisID;
32+
protected String yAxisID;
33+
protected Number barPercentage;
34+
protected Number categoryPercentage;
35+
protected Object barThickness;
36+
protected Number maxBarThickness;
37+
protected Number minBarLength;
38+
protected PointStyle pointStyle;
39+
protected Boolean grouped;
40+
41+
protected final List<BorderSkipped> borderSkipped = new OptionalArray<>();
3242

3343
@Override
3444
protected String defaultType()
3545
{
3646
return "bar";
3747
}
3848

39-
public String getLabel()
40-
{
41-
return this.label;
42-
}
43-
44-
public BarDataset setLabel(final String label)
45-
{
46-
this.label = label;
47-
return this;
48-
}
49-
5049
public String getXAxisID()
5150
{
5251
return this.xAxisID;
@@ -69,6 +68,83 @@ public BarDataset setYAxisID(final String yAxisID)
6968
return this;
7069
}
7170

71+
public Number getBarPercentage()
72+
{
73+
return this.barPercentage;
74+
}
75+
76+
public BarDataset setBarPercentage(final Number barPercentage)
77+
{
78+
this.barPercentage = barPercentage;
79+
return this;
80+
}
81+
82+
public Number getCategoryPercentage()
83+
{
84+
return this.categoryPercentage;
85+
}
86+
87+
public BarDataset setCategoryPercentage(final Number categoryPercentage)
88+
{
89+
this.categoryPercentage = categoryPercentage;
90+
return this;
91+
}
92+
93+
public Object getBarThickness()
94+
{
95+
return this.barThickness;
96+
}
97+
98+
public BarDataset setBarThickness(final Object barThickness)
99+
{
100+
this.barThickness = barThickness;
101+
return this;
102+
}
103+
104+
public Number getMaxBarThickness()
105+
{
106+
return this.maxBarThickness;
107+
}
108+
109+
public BarDataset setMaxBarThickness(final Number maxBarThickness)
110+
{
111+
this.maxBarThickness = maxBarThickness;
112+
return this;
113+
}
114+
115+
public Number getMinBarLength()
116+
{
117+
return this.minBarLength;
118+
}
119+
120+
public BarDataset setMinBarLength(final Number minBarLength)
121+
{
122+
this.minBarLength = minBarLength;
123+
return this;
124+
}
125+
126+
public PointStyle getPointStyle()
127+
{
128+
return this.pointStyle;
129+
}
130+
131+
public BarDataset setPointStyle(final PointStyle pointStyle)
132+
{
133+
this.pointStyle = pointStyle;
134+
return this;
135+
}
136+
137+
public Boolean getGrouped()
138+
{
139+
return this.grouped;
140+
}
141+
142+
public BarDataset setGrouped(final Boolean grouped)
143+
{
144+
this.grouped = grouped;
145+
return this;
146+
}
147+
72148
public List<BorderSkipped> getBorderSkipped()
73149
{
74150
return this.borderSkipped;
@@ -89,15 +165,4 @@ public BarDataset setBorderSkipped(final List<BorderSkipped> borderSkipped)
89165
}
90166
return this;
91167
}
92-
93-
public String getStack()
94-
{
95-
return this.stack;
96-
}
97-
98-
public BarDataset setStack(final String stack)
99-
{
100-
this.stack = stack;
101-
return this;
102-
}
103168
}

Diff for: chartjs-java-model/src/main/java/software/xdev/chartjs/model/dataset/BubbleDataset.java

+29-10
Original file line numberDiff line numberDiff line change
@@ -23,26 +23,45 @@
2323

2424

2525
/**
26-
* <p>
27-
* A collection of data points for a bubble chart.
28-
* </p>
29-
*
30-
* <p>
31-
* For best results, ensure that each property is set with a list of equal length.
32-
* </p>
26+
* @see <a href="https://github.com/chartjs/Chart.js/blob/v4.4.4/src/types/index.d.ts#L165">ChartJS Source</a>
3327
*/
34-
public class BubbleDataset extends RoundDataset<BubbleDataset, BubbleDataPoint>
28+
public class BubbleDataset extends BackgroundBorderHoverDataset<BubbleDataset, BubbleDataPoint>
3529
{
36-
private final List<Integer> hoverRadius = new OptionalArray<>();
30+
protected String xAxisID;
31+
protected String yAxisID;
32+
33+
protected final List<Integer> hoverRadius = new OptionalArray<>();
3734

38-
private PointStyle pointStyle;
35+
protected PointStyle pointStyle;
3936

4037
@Override
4138
protected String defaultType()
4239
{
4340
return "bubble";
4441
}
4542

43+
public String getXAxisID()
44+
{
45+
return this.xAxisID;
46+
}
47+
48+
public BubbleDataset setXAxisID(final String xAxisID)
49+
{
50+
this.xAxisID = xAxisID;
51+
return this;
52+
}
53+
54+
public String getYAxisID()
55+
{
56+
return this.yAxisID;
57+
}
58+
59+
public BubbleDataset setYAxisID(final String yAxisID)
60+
{
61+
this.yAxisID = yAxisID;
62+
return this;
63+
}
64+
4665
/**
4766
* <p>
4867
* Additional radius to add to data radius on hover.

0 commit comments

Comments
 (0)