Skip to content

Commit 98d5750

Browse files
committed
Simulate a gap in the data
1 parent 164c7c2 commit 98d5750

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

app/src/main/kotlin/info/appdev/chartexample/FilledLineActivity.kt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,23 @@ class FilledLineActivity : DemoBase() {
7474

7575
for (i in 0..<count) {
7676
val valueY = (sampleValues[i]!!.toFloat() * range) + 50
77+
if (count / 2 == i) {
78+
// Simulate a gap in the data
79+
valuesArray1.add(null)
80+
continue
81+
}
7782
valuesArray1.add(Entry(i.toFloat(), valueY))
7883
}
7984

8085
val valuesArray2 = ArrayList<Entry?>()
8186

8287
for (i in 0..<count) {
8388
val valueY = (sampleValues[i + 1]!!.toFloat() * range) + 450
89+
if (count / 4 == i) {
90+
// Simulate a gap in the data
91+
valuesArray2.add(null)
92+
continue
93+
}
8494
valuesArray2.add(Entry(i.toFloat(), valueY))
8595
}
8696

0 commit comments

Comments
 (0)