Skip to content
This repository has been archived by the owner on Jul 10, 2020. It is now read-only.

Commit

Permalink
refactor(option): #61: Support multiple font colors for radial chart …
Browse files Browse the repository at this point in the history
…labels
  • Loading branch information
Michael Oberwasserlechner committed May 30, 2018
1 parent a860dd6 commit cc8a702
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
import elemental.json.Json;
import elemental.json.JsonObject;

import java.util.Arrays;
import java.util.List;

/**
* Used to configure the point labels that are shown on the perimeter of the scale.
*
Expand All @@ -18,7 +21,7 @@ public class RadialPointLabel<T> extends And<T> implements JsonBuilder {

// TODO callback Callback function to transform data label to axis label
private Boolean display;
private String fontColor;
private List<String> fontColor;
private String fontFamily;
private Integer fontSize;
private String fontStyle;
Expand All @@ -34,8 +37,8 @@ public RadialPointLabel<T> display(boolean display) {
/**
* Font color. Default: #666
*/
public RadialPointLabel<T> fontColor(String fontColor) {
this.fontColor = fontColor;
public RadialPointLabel<T> fontColor(String... fontColor) {
this.fontColor = Arrays.asList(fontColor);
return this;
}

Expand Down Expand Up @@ -72,7 +75,7 @@ public RadialPointLabel(T parent) {
public JsonObject buildJson() {
JsonObject map = Json.createObject();
JUtils.putNotNull(map, "display", display);
JUtils.putNotNull(map, "fontColor", fontColor);
JUtils.putNotNullList(map, "fontColor", fontColor);
JUtils.putNotNull(map, "fontFamily", fontFamily);
JUtils.putNotNull(map, "fontSize", fontSize);
JUtils.putNotNull(map, "fontStyle", fontStyle);
Expand Down

0 comments on commit cc8a702

Please sign in to comment.