Added animated option on Bar Charts.
This commit is contained in:
parent
f179c75281
commit
c9f0b7ed81
2 changed files with 16 additions and 0 deletions
|
@ -35,6 +35,7 @@ public class BarChart
|
||||||
private StringList labels;
|
private StringList labels;
|
||||||
private BarChartDatasets datasets;
|
private BarChartDatasets datasets;
|
||||||
private boolean stacked;
|
private boolean stacked;
|
||||||
|
private boolean animated;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Instantiates a new bar chart.
|
* Instantiates a new bar chart.
|
||||||
|
@ -49,6 +50,7 @@ public class BarChart
|
||||||
this.labels = new StringList();
|
this.labels = new StringList();
|
||||||
this.datasets = new BarChartDatasets();
|
this.datasets = new BarChartDatasets();
|
||||||
this.stacked = false;
|
this.stacked = false;
|
||||||
|
this.animated = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -163,6 +165,11 @@ public class BarChart
|
||||||
return this.title;
|
return this.title;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isAnimated()
|
||||||
|
{
|
||||||
|
return this.animated;
|
||||||
|
}
|
||||||
|
|
||||||
public boolean isDisplayTitle()
|
public boolean isDisplayTitle()
|
||||||
{
|
{
|
||||||
return this.displayTitle;
|
return this.displayTitle;
|
||||||
|
@ -173,6 +180,11 @@ public class BarChart
|
||||||
return this.stacked;
|
return this.stacked;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setAnimated(final boolean animated)
|
||||||
|
{
|
||||||
|
this.animated = animated;
|
||||||
|
}
|
||||||
|
|
||||||
public void setDisplayTitle(final boolean displayTitle)
|
public void setDisplayTitle(final boolean displayTitle)
|
||||||
{
|
{
|
||||||
this.displayTitle = displayTitle;
|
this.displayTitle = displayTitle;
|
||||||
|
|
|
@ -117,6 +117,10 @@ public class BarChartView
|
||||||
lines.append(" },\n");
|
lines.append(" },\n");
|
||||||
lines.append(" stacked: ").append(chart.isStacked()).appendln(",");
|
lines.append(" stacked: ").append(chart.isStacked()).appendln(",");
|
||||||
lines.append(" }]\n");
|
lines.append(" }]\n");
|
||||||
|
lines.append(" },\n");
|
||||||
|
lines.append(" animation:\n");
|
||||||
|
lines.append(" {\n");
|
||||||
|
lines.append(" duration: ").append(chart.isAnimated() ? 1000 : 0).appendln();
|
||||||
lines.append(" }\n");
|
lines.append(" }\n");
|
||||||
lines.append(" }\n");
|
lines.append(" }\n");
|
||||||
lines.append("}");
|
lines.append("}");
|
||||||
|
|
Loading…
Reference in a new issue