From dcff371fa6b06cf4e4cda833d7fc15b51907d47c Mon Sep 17 00:00:00 2001 From: Johannes Goebel Date: Fri, 4 Jun 2021 12:08:52 +0200 Subject: [PATCH] close #108 --- .../apexcharts/config/plotoptions/Pie.java | 55 ++++++++++++------- .../plotoptions/builder/PieBuilder.java | 14 +++++ 2 files changed, 50 insertions(+), 19 deletions(-) diff --git a/src/main/java/com/github/appreciated/apexcharts/config/plotoptions/Pie.java b/src/main/java/com/github/appreciated/apexcharts/config/plotoptions/Pie.java index d09d14b..ff7e962 100644 --- a/src/main/java/com/github/appreciated/apexcharts/config/plotoptions/Pie.java +++ b/src/main/java/com/github/appreciated/apexcharts/config/plotoptions/Pie.java @@ -8,6 +8,8 @@ public class Pie { private Double customScale; private Double offsetX; private Double offsetY; + private Double startAngle; + private Double endAngle; private Boolean expandOnClick; private DataLabels dataLabels; private Donut donut; @@ -19,56 +21,71 @@ public Double getSize() { return size; } + public void setSize(Double size) { + this.size = size; + } + public Double getCustomScale() { return customScale; } + public void setCustomScale(Double customScale) { + this.customScale = customScale; + } + public Double getOffsetX() { return offsetX; } + public void setOffsetX(Double offsetX) { + this.offsetX = offsetX; + } + public Double getOffsetY() { return offsetY; } + public void setOffsetY(Double offsetY) { + this.offsetY = offsetY; + } + public Boolean getExpandOnClick() { return expandOnClick; } - public DataLabels getDataLabels() { - return dataLabels; + public void setExpandOnClick(Boolean expandOnClick) { + this.expandOnClick = expandOnClick; } - public Donut getDonut() { - return donut; + public DataLabels getDataLabels() { + return dataLabels; } - public void setSize(Double size) { - this.size = size; + public void setDataLabels(DataLabels dataLabels) { + this.dataLabels = dataLabels; } - public void setCustomScale(Double customScale) { - this.customScale = customScale; + public Donut getDonut() { + return donut; } - public void setOffsetX(Double offsetX) { - this.offsetX = offsetX; + public void setDonut(Donut donut) { + this.donut = donut; } - public void setOffsetY(Double offsetY) { - this.offsetY = offsetY; + public Double getStartAngle() { + return startAngle; } - public void setExpandOnClick(Boolean expandOnClick) { - this.expandOnClick = expandOnClick; + public void setStartAngle(Double startAngle) { + this.startAngle = startAngle; } - public void setDataLabels(DataLabels dataLabels) { - this.dataLabels = dataLabels; + public Double getEndAngle() { + return endAngle; } - public void setDonut(Donut donut) { - this.donut = donut; + public void setEndAngle(Double endAngle) { + this.endAngle = endAngle; } - } diff --git a/src/main/java/com/github/appreciated/apexcharts/config/plotoptions/builder/PieBuilder.java b/src/main/java/com/github/appreciated/apexcharts/config/plotoptions/builder/PieBuilder.java index f3a92af..d3e63b8 100644 --- a/src/main/java/com/github/appreciated/apexcharts/config/plotoptions/builder/PieBuilder.java +++ b/src/main/java/com/github/appreciated/apexcharts/config/plotoptions/builder/PieBuilder.java @@ -9,6 +9,8 @@ public class PieBuilder { private Double customScale; private Double offsetX; private Double offsetY; + private Double startAngle; + private Double endAngle; private Boolean expandOnClick; private DataLabels dataLabels; private Donut donut; @@ -55,6 +57,16 @@ public PieBuilder withDonut(Donut donut) { return this; } + public PieBuilder withStartAngle(Double startAngle) { + this.startAngle = startAngle; + return this; + } + + public PieBuilder withEndAngle(Double endAngle) { + this.endAngle = endAngle; + return this; + } + public Pie build() { Pie pie = new Pie(); pie.setSize(size); @@ -64,6 +76,8 @@ public Pie build() { pie.setExpandOnClick(expandOnClick); pie.setDataLabels(dataLabels); pie.setDonut(donut); + pie.setStartAngle(startAngle); + pie.setEndAngle(endAngle); return pie; } }