Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 2.9.0
* Synced `LineOptions` from ChartJS source code #439
* Updated dependencies

# 2.8.1
* Migrated deployment to _Sonatype Maven Central Portal_ [#155](https://github.com/xdev-software/standard-maven-template/issues/155)

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.8.2-SNAPSHOT</version>
<version>2.9.0-SNAPSHOT</version>
</parent>

<artifactId>chartjs-java-model-demo</artifactId>
<version>2.8.2-SNAPSHOT</version>
<version>2.9.0-SNAPSHOT</version>
<packaging>jar</packaging>

<organization>
Expand Down
2 changes: 1 addition & 1 deletion 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.8.2-SNAPSHOT</version>
<version>2.9.0-SNAPSHOT</version>
<packaging>jar</packaging>

<name>chartjs-java-model</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,11 @@
import software.xdev.chartjs.model.enums.BorderCapStyle;
import software.xdev.chartjs.model.enums.BorderJoinStyle;
import software.xdev.chartjs.model.objects.OptionalArray;
import software.xdev.chartjs.model.options.elements.Fill;


public abstract class PointDataset<T extends Dataset<T, O>, O> extends Dataset<T, O>
{
private Fill<?> fill;
private Object fill;

private Float lineTension;

Expand Down Expand Up @@ -64,18 +63,12 @@ public abstract class PointDataset<T extends Dataset<T, O>, O> extends Dataset<T

private final List<Object> pointStyle = new OptionalArray<>();

/**
* @see #setFill(Fill)
*/
public Fill getFill()
public Object getFill()
{
return this.fill;
}

/**
* If true, fill the area under the line
*/
public T setFill(final Fill<?> fill)
public T setFill(final Object fill)
{
this.fill = fill;
return this.self();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,85 @@
*/
public class LineOptions extends Options<LineOptions, DefaultAnimation>
{
protected Object borderCapStyle;
protected Number[] borderDash;
protected Number borderDashOffset;
protected Object borderJoinStyle;
protected Boolean capBezierPoints;
protected String cubicInterpolationMode;
protected Number tension;
protected Object stepped;

/**
* @see #setShowLine(Boolean)
*/
protected Boolean showLine;
/**
* @see #setSpanGaps(Boolean)
*/
protected Boolean spanGaps;
protected Object fill;
protected Object spanGaps;
protected LineElements elements;

public Object getBorderCapStyle()
{
return this.borderCapStyle;
}

public LineOptions setBorderCapStyle(final Object borderCapStyle)
{
this.borderCapStyle = borderCapStyle;
return this;
}

public Number[] getBorderDash()
{
return this.borderDash;
}

public LineOptions setBorderDash(final Number[] borderDash)
{
this.borderDash = borderDash;
return this;
}

public Number getBorderDashOffset()
{
return this.borderDashOffset;
}

public LineOptions setBorderDashOffset(final Number borderDashOffset)
{
this.borderDashOffset = borderDashOffset;
return this;
}

public Object getBorderJoinStyle()
{
return this.borderJoinStyle;
}

public LineOptions setBorderJoinStyle(final Object borderJoinStyle)
{
this.borderJoinStyle = borderJoinStyle;
return this;
}

public Boolean getCapBezierPoints()
{
return this.capBezierPoints;
}

public LineOptions setCapBezierPoints(final Boolean capBezierPoints)
{
this.capBezierPoints = capBezierPoints;
return this;
}

public String getCubicInterpolationMode()
{
return this.cubicInterpolationMode;
}

public LineOptions setCubicInterpolationMode(final String cubicInterpolationMode)
{
this.cubicInterpolationMode = cubicInterpolationMode;
return this;
}

public Number getTension()
{
return this.tension;
Expand All @@ -59,64 +125,44 @@ public LineOptions setStepped(final Object stepped)
return this;
}

/**
* @see #setShowLine(Boolean)
*/
public Boolean getShowLine()
{
return this.showLine;
}

/**
* <p>
* If false, the lines between points are not drawn
* </p>
*
* <p>
* Default {@code true}
* </p>
*/
public LineOptions setShowLine(final Boolean showLine)
{
this.showLine = showLine;
return this;
}

/**
* @see #setSpanGaps(Boolean)
*/
public Boolean getSpanGaps()
public Object getFill()
{
return this.fill;
}

public LineOptions setFill(final Object fill)
{
this.fill = fill;
return this;
}

public Object getSpanGaps()
{
return this.spanGaps;
}

/**
* <p>
* If true, NaN data does not break the line
* </p>
*
* <p>
* Default {@code false}
* </p>
*/
public LineOptions setSpanGaps(final Boolean spanGaps)
public LineOptions setSpanGaps(final Object spanGaps)
{
this.spanGaps = spanGaps;
return this;
}

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

/**
* @param elements an {@link LineElements} instance, or {@code null}
* @return this instance for method chaining
*/
public LineOptions setElements(final LineElements elements)
{
this.elements = elements;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@
* <p>
* Option on the dataset object which can be used to create area between two datasets or a dataset and a boundary.
* </p>
* @deprecated Use corresponding data type like <code>Boolean</code> or <code>String</code> directly.
* All internal usages have been replaced by <code>Object</code>.
*/
@Deprecated
public class Fill<T>
{
@SuppressWarnings("java:S1700") // Used inside JSON model
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public class Line
protected Float borderDashOffset;
protected BorderJoinStyle borderJoinStyle;
protected Boolean capBezierPoints;
protected Fill<?> fill;
protected Object fill;
protected Boolean stepped;

/**
Expand Down Expand Up @@ -277,10 +277,7 @@ public Line setCapBezierPoints(final Boolean capBezierPoints)
return this;
}

/**
* @see #setFill(Fill)
*/
public Fill getFill()
public Object getFill()
{
return this.fill;
}
Expand All @@ -294,7 +291,7 @@ public Fill getFill()
* Default {@code true}
* </p>
*/
public Line setFill(final Fill<?> fill)
public Line setFill(final Object fill)
{
this.fill = fill;
return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
*/
public class LineElements
{

protected Line line;
protected Point point;

Expand Down
2 changes: 1 addition & 1 deletion 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-root</artifactId>
<version>2.8.2-SNAPSHOT</version>
<version>2.9.0-SNAPSHOT</version>
<packaging>pom</packaging>

<organization>
Expand Down