Skip to content

Commit 3bdccc1

Browse files
authored
Merge pull request #807 from AppDevNext/CosmeticLegend
Cosmetic in Legend
2 parents 0b87dbe + d8d07bb commit 3bdccc1

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

  • chartLib/src/main/kotlin/info/appdev/charting/components

chartLib/src/main/kotlin/info/appdev/charting/components/Legend.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class Legend() : ComponentBase() {
2727
NONE,
2828

2929
/**
30-
* Do not draw the a form, but leave space for it
30+
* Do not draw the form, but leave space for it
3131
*/
3232
EMPTY,
3333

@@ -71,14 +71,14 @@ class Legend() : ComponentBase() {
7171
/**
7272
* The legend entries array
7373
*/
74-
var entries: Array<LegendEntry> = arrayOf<LegendEntry>()
74+
var entries: Array<LegendEntry> = arrayOf()
7575
private set
7676

7777
/**
7878
* Entries that will be appended to the end of the auto calculated entries after calculating the legend.
7979
* (if the legend has already been calculated, you will need to call notifyDataSetChanged() to let the changes take effect)
8080
*/
81-
var extraEntries: Array<LegendEntry> = arrayOf<LegendEntry>()
81+
var extraEntries: Array<LegendEntry> = arrayOf()
8282
private set
8383

8484
/**
@@ -218,8 +218,8 @@ class Legend() : ComponentBase() {
218218
var max = 0f
219219

220220
for (entry in this.entries) {
221-
val label = entry.label
222-
if (label == null) continue
221+
if (entry == null) continue
222+
val label = entry.label ?: continue
223223

224224
val length = p.calcTextHeight(label).toFloat()
225225

0 commit comments

Comments
 (0)