Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
1c8bb85
Merge pull request #287 from xdev-software/master
AB-xdev Nov 20, 2024
8f05740
Update testcontainers-version to v1.20.4
xdev-renovate Nov 21, 2024
77eb1b9
Merge pull request #288 from xdev-software/renovate/testcontainers-ve…
AB-xdev Nov 21, 2024
d12ec22
Generate sources and javadoc during package and not verify
AB-xdev Nov 22, 2024
642a78f
Merge branch 'develop' into update-from-template-merged
xdev-gh-bot Nov 25, 2024
2ec98d3
Update net.sourceforge.pmd to v7.8.0
xdev-renovate Nov 30, 2024
6b853f1
Update dependency com.puppycrawl.tools:checkstyle to v10.20.2
xdev-renovate Dec 1, 2024
3c1b46c
Merge pull request #120 from xdev-software/renovate/net.sourceforge.pmd
AB-xdev Dec 2, 2024
143c769
Merge pull request #121 from xdev-software/renovate/com.puppycrawl.to…
AB-xdev Dec 2, 2024
b59a055
Merge branch 'develop' into update-from-template-merged
xdev-gh-bot Dec 6, 2024
0ae5ac2
Update dependency com.fasterxml.jackson.core:jackson-databind to v2.18.2
xdev-renovate Dec 6, 2024
7494258
Update log4j-version to v2.24.2
xdev-renovate Dec 6, 2024
da7176c
Update dependency org.seleniumhq.selenium:selenium-chrome-driver to v…
xdev-renovate Dec 6, 2024
6ebacab
Merge pull request #290 from xdev-software/renovate/log4j-version
AB-xdev Dec 6, 2024
ce8dbfe
Merge pull request #295 from xdev-software/renovate/com.fasterxml.jac…
AB-xdev Dec 6, 2024
729909d
Merge pull request #292 from xdev-software/renovate/org.seleniumhq.se…
AB-xdev Dec 6, 2024
e3e0ce4
Reimplement and correct doughnut/pie options
AB-xdev Dec 6, 2024
c8e2e76
Bump version + Changelog
AB-xdev Dec 6, 2024
dae35d5
Update CHANGELOG.md
AB-xdev Dec 6, 2024
39778ab
Merge branch 'dougnut-pie-options' into develop
AB-xdev Dec 6, 2024
1cf2610
Fix comment
AB-xdev Dec 6, 2024
7f77dc7
private -> protected
AB-xdev Dec 6, 2024
24a1a04
Synced ``GridLineConfiguration`` from ChartJS source code / improved …
AB-xdev Dec 6, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 2.6.0
* Synced ``Doughnut/PieOptions`` from ChartJS source code #293
* Synced ``GridLineConfiguration`` from ChartJS source code / improved Types for more options #289
* Updated dependencies

## 2.5.0
* Synced ``Legend`` from ChartJS source code #285

Expand Down
4 changes: 2 additions & 2 deletions chartjs-java-model-demo/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
<parent>
<groupId>software.xdev</groupId>
<artifactId>chartjs-java-model-root</artifactId>
<version>2.5.1-SNAPSHOT</version>
<version>2.6.0-SNAPSHOT</version>
</parent>

<artifactId>chartjs-java-model-demo</artifactId>
<version>2.5.1-SNAPSHOT</version>
<version>2.6.0-SNAPSHOT</version>
<packaging>jar</packaging>

<organization>
Expand Down
20 changes: 10 additions & 10 deletions chartjs-java-model/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>software.xdev</groupId>
<artifactId>chartjs-java-model</artifactId>
<version>2.5.1-SNAPSHOT</version>
<version>2.6.0-SNAPSHOT</version>
<packaging>jar</packaging>

<name>chartjs-java-model</name>
Expand Down Expand Up @@ -49,8 +49,8 @@
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

<slf4j-version>2.0.16</slf4j-version>
<log4j-version>2.24.1</log4j-version>
<testcontainers-version>1.20.3</testcontainers-version>
<log4j-version>2.24.2</log4j-version>
<testcontainers-version>1.20.4</testcontainers-version>

<!-- by default run no tests as Docker is required -->
<skipTests>true</skipTests>
Expand Down Expand Up @@ -95,7 +95,7 @@
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.18.1</version>
<version>2.18.2</version>
</dependency>

<!-- Tests -->
Expand Down Expand Up @@ -170,7 +170,7 @@
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-chrome-driver</artifactId>
<version>4.26.0</version>
<version>4.27.0</version>
<scope>test</scope>
<exclusions>
<!-- Tracing is not needed -->
Expand Down Expand Up @@ -245,7 +245,7 @@
<executions>
<execution>
<id>attach-javadocs</id>
<phase>verify</phase>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
Expand All @@ -263,7 +263,7 @@
<executions>
<execution>
<id>attach-sources</id>
<phase>verify</phase>
<phase>package</phase>
<goals>
<goal>jar-no-fork</goal>
</goals>
Expand Down Expand Up @@ -360,7 +360,7 @@
<dependency>
<groupId>com.puppycrawl.tools</groupId>
<artifactId>checkstyle</artifactId>
<version>10.20.1</version>
<version>10.20.2</version>
</dependency>
</dependencies>
<configuration>
Expand Down Expand Up @@ -397,12 +397,12 @@
<dependency>
<groupId>net.sourceforge.pmd</groupId>
<artifactId>pmd-core</artifactId>
<version>7.7.0</version>
<version>7.8.0</version>
</dependency>
<dependency>
<groupId>net.sourceforge.pmd</groupId>
<artifactId>pmd-java</artifactId>
<version>7.7.0</version>
<version>7.8.0</version>
</dependency>
</dependencies>
</plugin>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,100 +16,8 @@
package software.xdev.chartjs.model.options;

import software.xdev.chartjs.model.options.animation.DoughnutAnimation;
import software.xdev.chartjs.model.options.elements.ArcElements;


public class DoughnutOptions extends Options<DoughnutOptions, DoughnutAnimation>
public class DoughnutOptions extends DoughnutOptionsBase<DoughnutOptions, DoughnutAnimation>
{
/**
* Default {@code 50}
*
* @see #setCutout(Number cutout)
*/
protected Number cutout;

/**
* Rotation in degrees. Default {@code 0}. {@code 0} is at the top.
*
* @see #setRotation(Number rotation)
*/
protected Number rotation;

/**
* Circumference in degrees. Default {@code 360}.
*
* @see #setCircumference(Number circumference)
*/
protected Number circumference;

protected ArcElements elements;

/**
* @see #setCutout(Number cutoutPercentage)
*/
public Number getCutout()
{
return this.cutout;
}

/**
* The pixels as number of the chart that is cut out of the middle.
*/
public DoughnutOptions setCutout(final Number cutout)
{
this.cutout = cutout;
return this;
}

/**
* @see #setRotation(Number rotation)
*/
public Number getRotation()
{
return this.rotation;
}

/**
* Starting angle to draw arcs from in degrees
*/
public DoughnutOptions setRotation(final Number rotation)
{
this.rotation = rotation;
return this;
}

/**
* @see #setCircumference(Number circumference)
*/
public Number getCircumference()
{
return this.circumference;
}

/**
* Sweep to allow arcs to cover in degrees
*/
public DoughnutOptions setCircumference(final Number circumference)
{
this.circumference = circumference;
return this;
}

/**
* @return {@link ArcElements} instance, or {@code null} if not set
*/
public ArcElements getElements()
{
return this.elements;
}

/**
* @param elements an {@link ArcElements} instance, or {@code null}
* @return this instance for method chaining
*/
public DoughnutOptions setElements(final ArcElements elements)
{
this.elements = elements;
return this;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
/*
* Copyright © 2023 XDEV Software (https://xdev.software)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package software.xdev.chartjs.model.options;

import software.xdev.chartjs.model.options.animation.DoughnutAnimationBase;


/**
* @see <a href="https://github.com/chartjs/Chart.js/blob/v4.4.6/src/types/index.d.ts#L298">ChartJS Source</a>
*/
public abstract class DoughnutOptionsBase<O extends DoughnutOptionsBase<O, A>, A extends DoughnutAnimationBase<A>>
extends Options<O, A>
{
protected Number circumference;
protected Object cutout; // number or string
protected Object offset; // number or number[]
protected Object radius; // number or string
protected Number rotation;
protected Number spacing;

public Number getCircumference()
{
return this.circumference;
}

public DoughnutOptionsBase<O, A> setCircumference(final Number circumference)
{
this.circumference = circumference;
return this.self();
}

public Object getCutout()
{
return this.cutout;
}

public DoughnutOptionsBase<O, A> setCutout(final Object cutout)
{
this.cutout = cutout;
return this.self();
}

public Object getOffset()
{
return this.offset;
}

public DoughnutOptionsBase<O, A> setOffset(final Object offset)
{
this.offset = offset;
return this.self();
}

public Object getRadius()
{
return this.radius;
}

public DoughnutOptionsBase<O, A> setRadius(final Object radius)
{
this.radius = radius;
return this.self();
}

public Number getRotation()
{
return this.rotation;
}

public DoughnutOptionsBase<O, A> setRotation(final Number rotation)
{
this.rotation = rotation;
return this.self();
}

public Number getSpacing()
{
return this.spacing;
}

public DoughnutOptionsBase<O, A> setSpacing(final Number spacing)
{
this.spacing = spacing;
return this.self();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@


/**
* @see <a href="https://github.com/chartjs/Chart.js/blob/v4.4.3/src/types/index.d.ts#L1588">ChartJS Source</a>
* @see <a href="https://github.com/chartjs/Chart.js/blob/v4.4.7/src/types/index.d.ts#L1588">
* ChartJS Source (Options)</a>
* @see <a href="https://github.com/chartjs/Chart.js/blob/v4.4.7/src/types/index.d.ts#L1756">
* ChartJS Source (AnimationOptons)</a>
*/
public class Options<T extends Options<T, A>, A extends Animation<A>>
{
Expand All @@ -43,7 +46,7 @@ public class Options<T extends Options<T, A>, A extends Animation<A>>
protected CoreInteractionOptions interaction;
protected CoreInteractionOptions hover;
protected Animations<A> animations;
protected Boolean animation = true;
protected Object animation; // Usually a boolean or of Type <A>
protected Layout layout;
protected Plugins plugins = new Plugins();

Expand Down Expand Up @@ -89,18 +92,12 @@ public T setResponsive(final Boolean responsive)
return this.self();
}

/**
* @see #setAnimation(Boolean)
*/
public Boolean getAnimation()
public Object getAnimation()
{
return this.animation;
}

/**
* Default {@code true} Disables the Animation completely if set to {@code false}.
*/
public T setAnimation(final Boolean animation)
public T setAnimation(final Object animation)
{
this.animation = animation;
return this.self();
Expand Down
Loading
Loading