Skip to content

Commit d8d07bb

Browse files
committed
Cosmetic in Legend
1 parent a5db2f4 commit d8d07bb

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
/**
@@ -217,8 +217,8 @@ class Legend() : ComponentBase() {
217217
var max = 0f
218218

219219
for (entry in this.entries) {
220-
val label = entry.label
221-
if (label == null) continue
220+
if (entry == null) continue
221+
val label = entry.label ?: continue
222222

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

0 commit comments

Comments
 (0)