Skip to content

Commit

Permalink
BgSparkLine: add dot size parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
jamorham committed Mar 6, 2024
1 parent b8f7a6a commit 04e075a
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ public class BgSparklineBuilder {
protected boolean useSmallDots = true;
protected boolean useTinyDots = false;
protected boolean showFiltered = false;

protected Integer useSpecificDotSize = null;
protected int backgroundColor = Color.TRANSPARENT;
protected final static int SCALE_TRIGGER = 84;

Expand Down Expand Up @@ -123,6 +125,11 @@ public BgSparklineBuilder setSmallDots() {

public BgSparklineBuilder setTinyDots() { return this.setTinyDots(true); }

public BgSparklineBuilder setDotSize(int size) {
this.useSpecificDotSize = size;
return this;
}

public BgSparklineBuilder setBackgroundColor(int color)
{
this.backgroundColor = color;
Expand Down Expand Up @@ -213,6 +220,10 @@ public Bitmap build() {
for(Line line: lines)
line.setPointRadius(1);
}
if (useSpecificDotSize != null) {
for(Line line: lines)
line.setPointRadius(useSpecificDotSize);
}
LineChartData lineData = new LineChartData(lines);
if (showAxes) {
if (height<=SCALE_TRIGGER) {
Expand Down

0 comments on commit 04e075a

Please sign in to comment.