diff --git a/src/main/java/com/byteowls/vaadin/chartjs/data/LineDataset.java b/src/main/java/com/byteowls/vaadin/chartjs/data/LineDataset.java index 5852273..2fcb02c 100644 --- a/src/main/java/com/byteowls/vaadin/chartjs/data/LineDataset.java +++ b/src/main/java/com/byteowls/vaadin/chartjs/data/LineDataset.java @@ -1,7 +1,6 @@ package com.byteowls.vaadin.chartjs.data; import com.byteowls.vaadin.chartjs.options.elements.Line; -import com.byteowls.vaadin.chartjs.utils.ColorUtils; import com.byteowls.vaadin.chartjs.utils.JUtils; import elemental.json.Json; import elemental.json.JsonObject; @@ -104,13 +103,16 @@ public LineDataset fill(Line.FillMode fillMode) { /** * Sets the index of the target dataset till which it will be filled. */ - public LineDataset fillTo(int datasetIndex) { + public LineDataset fill(int datasetIndex) { this.fillToDatasetIndex = datasetIndex; return this; } - public LineDataset fillTo(boolean plus, int datasetIndex) { - this.fillToPlus = plus; + /** + * Fills the area between the current dataset and next or previous with the given index. + */ + public LineDataset fill(boolean next, int datasetIndex) { + this.fillToPlus = next; this.fillToDatasetIndex = datasetIndex; return this; } @@ -151,22 +153,6 @@ public LineDataset backgroundColor(String backgroundColor) { return this; } - /** - * The fill color as rgb array. - */ - public LineDataset backgroundColor(int[] rgb) { - this.backgroundColor(ColorUtils.toRgb(rgb)); - return this; - } - - /** - * The fill color as rgb array and a additional parameter for the alpha channel. - */ - public LineDataset backgroundColor(int[] rgb, double alpha) { - this.backgroundColor(ColorUtils.toRgba(rgb, alpha)); - return this; - } - /** * The width of the line in pixels */ @@ -183,22 +169,6 @@ public LineDataset borderColor(String borderColor) { return this; } - /** - * The color of the line as rgb array. - */ - public LineDataset borderColor(int[] rgb) { - this.borderColor(ColorUtils.toRgb(rgb)); - return this; - } - - /** - * The color of the line as rgb array and a additional parameter for the alpha channel. - */ - public LineDataset borderColor(int[] rgb, double alpha) { - this.borderColor(ColorUtils.toRgba(rgb, alpha)); - return this; - } - /** * Cap style of the line. See https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/lineCap */ diff --git a/src/main/java/com/byteowls/vaadin/chartjs/data/RadarDataset.java b/src/main/java/com/byteowls/vaadin/chartjs/data/RadarDataset.java index 315024b..4529456 100644 --- a/src/main/java/com/byteowls/vaadin/chartjs/data/RadarDataset.java +++ b/src/main/java/com/byteowls/vaadin/chartjs/data/RadarDataset.java @@ -1,7 +1,6 @@ package com.byteowls.vaadin.chartjs.data; import com.byteowls.vaadin.chartjs.options.elements.Line; -import com.byteowls.vaadin.chartjs.utils.ColorUtils; import com.byteowls.vaadin.chartjs.utils.JUtils; import elemental.json.Json; import elemental.json.JsonObject; @@ -78,13 +77,16 @@ public RadarDataset fill(Line.FillMode fillMode) { /** * Sets the index of the target dataset till which it will be filled. */ - public RadarDataset fillTo(int datasetIndex) { + public RadarDataset fill(int datasetIndex) { this.fillToDatasetIndex = datasetIndex; return this; } - public RadarDataset fillTo(boolean plus, int datasetIndex) { - this.fillToPlus = plus; + /** + * Fills the area between the current dataset and next or previous with the given index. + */ + public RadarDataset fill(boolean next, int datasetIndex) { + this.fillToPlus = next; this.fillToDatasetIndex = datasetIndex; return this; } @@ -113,22 +115,6 @@ public RadarDataset backgroundColor(String backgroundColor) { return this; } - /** - * The fill color as rgb array. - */ - public RadarDataset backgroundColor(int[] rgb) { - this.backgroundColor(ColorUtils.toRgb(rgb)); - return this; - } - - /** - * The fill color as rgb array and a additional parameter for the alpha channel. - */ - public RadarDataset backgroundColor(int[] rgb, double alpha) { - this.backgroundColor(ColorUtils.toRgba(rgb, alpha)); - return this; - } - /** * The width of the line in pixels */ @@ -145,22 +131,6 @@ public RadarDataset borderColor(String borderColor) { return this; } - /** - * The color of the line as rgb array. - */ - public RadarDataset borderColor(int[] rgb) { - this.borderColor(ColorUtils.toRgb(rgb)); - return this; - } - - /** - * The color of the line as rgb array and a additional parameter for the alpha channel. - */ - public RadarDataset borderColor(int[] rgb, double alpha) { - this.borderColor(ColorUtils.toRgba(rgb, alpha)); - return this; - } - /** * Cap style of the line. See https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/lineCap */