Skip to content

Commit d30a80f

Browse files
AB-xdevastappiev
andcommitted
Improve / Fix isDrawable
* PieChart: Fix condition for "...at least one data point" * others: Sync docs and code e.g. "at least two data points" -> ">= 2" is better readable than "> 1" Co-Authored-By: Oleh Astappiev <[email protected]>
1 parent a333108 commit d30a80f

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

chartjs-java-model/src/main/java/software/xdev/chartjs/model/charts/PieChart.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public boolean isDrawable()
7676
{
7777
for(final PieDataset dataset : this.getData().getDatasets())
7878
{
79-
if(dataset.getData().size() > 1)
79+
if(!dataset.getData().isEmpty())
8080
{
8181
return true;
8282
}

chartjs-java-model/src/main/java/software/xdev/chartjs/model/charts/PolarChart.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public boolean isDrawable()
7676
{
7777
for(final PolarDataset dataset : this.getData().getDatasets())
7878
{
79-
if(dataset.getData().size() > 1)
79+
if(dataset.getData().size() >= 2)
8080
{
8181
return true;
8282
}

chartjs-java-model/src/main/java/software/xdev/chartjs/model/charts/RadarChart.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public boolean isDrawable()
7676
{
7777
for(final RadarDataset dataset : this.getData().getDatasets())
7878
{
79-
if(dataset.getData().size() > 2)
79+
if(dataset.getData().size() >= 3)
8080
{
8181
return true;
8282
}

0 commit comments

Comments
 (0)