Skip to content

Commit 512d0af

Browse files
authored
Merge pull request #149 from xdev-software/develop
Release
2 parents aae90db + 05d7576 commit 512d0af

File tree

10 files changed

+368
-41
lines changed

10 files changed

+368
-41
lines changed

CHANGELOG.md

+10-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
## 1.3.1
2+
* Add subtitle option #141 (@aripddev)
3+
* Add ``PointStyle#rectRounded`` #143 (@aripddev)
4+
* Add ``BubbleDataset#pointStyle`` #144 (@aripddev)
5+
* ``reverse`` property should be on the ``Scale`` object #145
6+
* Added all available properties for ``Legend``
7+
18
## 1.3.0
29
* Allows creation of mixed charts #128
310
* New chart class: ``MixedChart``
@@ -7,8 +14,8 @@
714
* Slim down test dependencies
815

916
## 1.2.0
10-
* Add TimeScale and TimeTicks to allow building linear time charts #90
11-
* Add options for the [Zoom plugin](https://www.chartjs.org/chartjs-plugin-zoom/latest/) #117
17+
* Add TimeScale and TimeTicks to allow building linear time charts #90 (@astappiev)
18+
* Add options for the [Zoom plugin](https://www.chartjs.org/chartjs-plugin-zoom/latest/) #117 (@astappiev)
1219
* Updated dependencies
1320

1421
## 1.1.3
@@ -30,7 +37,7 @@
3037
* Updated dependencies
3138

3239
## 1.0.1
33-
* Added support for [stacked bar chart with groups](https://www.chartjs.org/docs/4.4.0/samples/bar/stacked-groups.html)
40+
* Added support for [stacked bar chart with groups](https://www.chartjs.org/docs/4.4.0/samples/bar/stacked-groups.html) (@dlemaignent)
3441

3542
## 1.0.0
3643
Initial release

CONTRIBUTING.md

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ You should have the following things installed:
2727
* Install the following plugins:
2828
* [Save Actions](https://plugins.jetbrains.com/plugin/22113) - Provides save actions, like running the formatter or adding ``final`` to fields
2929
* [SonarLint](https://plugins.jetbrains.com/plugin/7973-sonarlint) - CodeStyle/CodeAnalysis
30+
* You may consider disabling telemetry in the settings under ``Tools > Sonarlint -> About``
3031
* [Checkstyle-IDEA](https://plugins.jetbrains.com/plugin/1065-checkstyle-idea) - CodeStyle/CodeAnalysis
3132
* Import the project
3233
* Ensure that everything is encoded in ``UTF-8``

chartjs-java-model/pom.xml

+3-3
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050

5151
<slf4j-version>2.0.13</slf4j-version>
5252
<log4j-version>2.23.1</log4j-version>
53-
<testcontainers-version>1.19.7</testcontainers-version>
53+
<testcontainers-version>1.19.8</testcontainers-version>
5454

5555
<!-- by default run no tests as Docker is required -->
5656
<skipTests>true</skipTests>
@@ -188,7 +188,7 @@
188188
<plugin>
189189
<groupId>org.apache.maven.plugins</groupId>
190190
<artifactId>maven-site-plugin</artifactId>
191-
<version>4.0.0-M13</version>
191+
<version>4.0.0-M14</version>
192192
</plugin>
193193
<plugin>
194194
<groupId>org.apache.maven.plugins</groupId>
@@ -201,7 +201,7 @@
201201
<plugin>
202202
<groupId>com.mycila</groupId>
203203
<artifactId>license-maven-plugin</artifactId>
204-
<version>4.3</version>
204+
<version>4.5</version>
205205
<configuration>
206206
<properties>
207207
<email>${project.organization.url}</email>

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

+14
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import java.util.List;
1919

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

2324

@@ -34,6 +35,8 @@ public class BubbleDataset extends RoundDataset<BubbleDataset, BubbleDataPoint>
3435
{
3536
private final List<Integer> hoverRadius = new OptionalArray<>();
3637

38+
private PointStyle pointStyle;
39+
3740
@Override
3841
protected String defaultType()
3942
{
@@ -72,4 +75,15 @@ public List<Integer> getHoverRadius()
7275
{
7376
return this.hoverRadius;
7477
}
78+
79+
public PointStyle getPointStyle()
80+
{
81+
return this.pointStyle;
82+
}
83+
84+
public BubbleDataset setPointStyle(final PointStyle pointStyle)
85+
{
86+
this.pointStyle = pointStyle;
87+
return this;
88+
}
7589
}

chartjs-java-model/src/main/java/software/xdev/chartjs/model/enums/PointStyle.java

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ public enum PointStyle
2525
CIRCLE,
2626
TRIANGLE,
2727
RECT,
28+
RECT_ROUNDED,
2829
RECT_ROT,
2930
CROSS,
3031
CROSS_ROT,

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

+173-8
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,18 @@ public class Legend
2626
{
2727
protected Boolean display;
2828
protected Position position;
29-
protected Boolean fullWidth;
29+
protected String align;
30+
protected Integer maxHeight;
31+
protected Integer maxWidth;
32+
protected Boolean fullSize;
3033
protected JavaScriptFunction onClick;
34+
protected JavaScriptFunction onHover;
35+
protected JavaScriptFunction onLeave;
36+
protected Boolean reverse;
3137
protected LegendLabels labels;
38+
protected Boolean rtl;
39+
protected String textDirection;
40+
protected LegendTitle title;
3241

3342
/**
3443
* @see #setDisplay(Boolean)
@@ -69,21 +78,74 @@ public Legend setPosition(final Legend.Position position)
6978
}
7079

7180
/**
72-
* @see #setFullWidth(Boolean)
81+
* @see #setAlign(String)
7382
*/
74-
public Boolean getFullWidth()
83+
public String getAlign()
7584
{
76-
return this.fullWidth;
85+
return this.align;
86+
}
87+
88+
/**
89+
* Default 'center'.
90+
* <p>
91+
* Alignment of the legend
92+
*/
93+
public Legend setAlign(final String align)
94+
{
95+
this.align = align;
96+
return this;
97+
}
98+
99+
/**
100+
* @see #setMaxHeight(Integer)
101+
*/
102+
public Integer getMaxHeight()
103+
{
104+
return this.maxHeight;
105+
}
106+
107+
/**
108+
* Maximum height of the legend, in pixels
109+
*/
110+
public Legend setMaxHeight(final Integer maxHeight)
111+
{
112+
this.maxHeight = maxHeight;
113+
return this;
114+
}
115+
116+
/**
117+
* @see #setMaxWidth(Integer)
118+
*/
119+
public Integer getMaxWidth()
120+
{
121+
return this.maxWidth;
122+
}
123+
124+
/**
125+
* Maximum width of the legend, in pixels
126+
*/
127+
public Legend setMaxWidth(final Integer maxWidth)
128+
{
129+
this.maxWidth = maxWidth;
130+
return this;
131+
}
132+
133+
/**
134+
* @see #setFullSize(Boolean)
135+
*/
136+
public Boolean getFullSize()
137+
{
138+
return this.fullSize;
77139
}
78140

79141
/**
80142
* Default {@code true}
81143
* <p>
82144
* Marks that this box should take the full width of the canvas (pushing down other boxes)
83145
*/
84-
public Legend setFullWidth(final Boolean fullWidth)
146+
public Legend setFullSize(final Boolean fullSize)
85147
{
86-
this.fullWidth = fullWidth;
148+
this.fullSize = fullSize;
87149
return this;
88150
}
89151

@@ -96,8 +158,6 @@ public JavaScriptFunction getOnClick()
96158
}
97159

98160
/**
99-
* Default {@code function(event, legendItem) {}}
100-
* <p>
101161
* A callback that is called when a click is registered on top of a label item
102162
*/
103163
public Legend setOnClick(final JavaScriptFunction onClick)
@@ -106,6 +166,59 @@ public Legend setOnClick(final JavaScriptFunction onClick)
106166
return this;
107167
}
108168

169+
/**
170+
* @see #setOnHover(JavaScriptFunction)
171+
*/
172+
public JavaScriptFunction getOnHover()
173+
{
174+
return this.onHover;
175+
}
176+
177+
/**
178+
* A callback that is called when a 'mousemove' event is registered on top of a label item
179+
*/
180+
public Legend setOnHover(final JavaScriptFunction onHover)
181+
{
182+
this.onHover = onHover;
183+
return this;
184+
}
185+
186+
/**
187+
* @see #setOnLeave(JavaScriptFunction)
188+
*/
189+
public JavaScriptFunction getOnLeave()
190+
{
191+
return this.onLeave;
192+
}
193+
194+
/**
195+
* A callback that is called when a 'mousemove' event is registered outside of a previously hovered label item
196+
*/
197+
public Legend setOnLeave(final JavaScriptFunction onLeave)
198+
{
199+
this.onLeave = onLeave;
200+
return this;
201+
}
202+
203+
/**
204+
* @see #setReverse(Boolean)
205+
*/
206+
public Boolean getReverse()
207+
{
208+
return this.reverse;
209+
}
210+
211+
/**
212+
* Default <code>false</code>
213+
* <p>
214+
* Legend will show datasets in reverse order
215+
*/
216+
public Legend setReverse(final Boolean reverse)
217+
{
218+
this.reverse = reverse;
219+
return this;
220+
}
221+
109222
/**
110223
* @see #setLabels(LegendLabels)
111224
*/
@@ -125,6 +238,58 @@ public Legend setLabels(final LegendLabels labels)
125238
return this;
126239
}
127240

241+
/**
242+
* @see #setRtl(Boolean)
243+
*/
244+
public Boolean getRtl()
245+
{
246+
return this.rtl;
247+
}
248+
249+
/**
250+
* <code>true</code> for rendering the legends from right to left
251+
*/
252+
public Legend setRtl(final Boolean rtl)
253+
{
254+
this.rtl = rtl;
255+
return this;
256+
}
257+
258+
/**
259+
* @see #setTextDirection(String)
260+
*/
261+
public String getTextDirection()
262+
{
263+
return this.textDirection;
264+
}
265+
266+
/**
267+
* This will force the text direction 'rtl' or 'ltr' on the canvas for rendering the legend, regardless of the css
268+
* specified on the canvas
269+
*/
270+
public Legend setTextDirection(final String textDirection)
271+
{
272+
this.textDirection = textDirection;
273+
return this;
274+
}
275+
276+
/**
277+
* @see #setTitle(LegendTitle)
278+
*/
279+
public LegendTitle getTitle()
280+
{
281+
return this.title;
282+
}
283+
284+
/**
285+
* @see LegendTitle
286+
*/
287+
public Legend setTitle(final LegendTitle title)
288+
{
289+
this.title = title;
290+
return this;
291+
}
292+
128293
public enum Position
129294
{
130295
TOP,

0 commit comments

Comments
 (0)