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

Commit

Permalink
feat(option): #61: new option 'devicePixelRatio'
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Oberwasserlechner committed May 30, 2018
1 parent cc8a702 commit dcc6f58
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public abstract class AbstractOptions<T> implements JsonBuilder, Serializable {
protected Boolean responsive;
private Integer responsiveAnimationDuration;
private Boolean maintainAspectRatio;
private Integer devicePixelRatio;
private List<String> events;
private Title<T> title;
private Tooltips<T> tooltips;
Expand All @@ -43,7 +44,7 @@ public T responsive(boolean responsive) {
}

/**
* Maintain the original canvas aspect ratio (width / height) when resizing
* Maintain the original canvas aspect ratio (width / height) when resizing.
*/
public T maintainAspectRatio(boolean maintainAspectRatio) {
this.maintainAspectRatio = maintainAspectRatio;
Expand All @@ -58,6 +59,14 @@ public T responsiveAnimationDuration(int responsiveAnimationDurationMs) {
return getThis();
}

/**
* Defines the ratio between display pixels and rendered pixels.
*/
public T devicePixelRatio(int devicePixelRatio) {
this.devicePixelRatio = devicePixelRatio;
return getThis();
}

/**
* Events that the chart should listen to for tooltips and hovering
*/
Expand Down Expand Up @@ -155,6 +164,7 @@ public JsonObject buildJson() {
JUtils.putNotNull(map, "responsive", responsive);
JUtils.putNotNull(map, "maintainAspectRatio", maintainAspectRatio);
JUtils.putNotNull(map, "responsiveAnimationDuration", responsiveAnimationDuration);
JUtils.putNotNull(map, "devicePixelRatio", devicePixelRatio);
JUtils.putNotNull(map, "events", events);
JUtils.putNotNull(map, "title", title);
JUtils.putNotNull(map, "hover", hover);
Expand Down

0 comments on commit dcc6f58

Please sign in to comment.