Skip to content

Commit ee2d0c3

Browse files
committed
Gradient chart id
1 parent a882d64 commit ee2d0c3

2 files changed

Lines changed: 9 additions & 10 deletions

File tree

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ class GradientActivity : DemoBase() {
3232
Utils.init(this)
3333

3434
// Minimal chart setup
35-
binding.chart.description.isEnabled = false
36-
binding.chart.legend.isEnabled = false
37-
binding.chart.axisRight.isEnabled = false
38-
binding.chart.setDrawGridBackground(false)
35+
binding.chart1.description.isEnabled = false
36+
binding.chart1.legend.isEnabled = false
37+
binding.chart1.axisRight.isEnabled = false
38+
binding.chart1.setDrawGridBackground(false)
3939

4040
// -----------------------------
4141
// Linear function
@@ -64,13 +64,13 @@ class GradientActivity : DemoBase() {
6464
override fun getFillLinePosition(
6565
dataSet: ILineDataSet?,
6666
dataProvider: LineDataProvider
67-
): Float = binding.chart.axisLeft.axisMinimum
67+
): Float = binding.chart1.axisLeft.axisMinimum
6868
}
6969
}
7070

71-
binding.chart.axisLeft.axisMinimum = 0f
72-
binding.chart.data = LineData(dataSet)
73-
binding.chart.invalidate()
71+
binding.chart1.axisLeft.axisMinimum = 0f
72+
binding.chart1.data = LineData(dataSet)
73+
binding.chart1.invalidate()
7474
}
7575

7676
override fun saveToGallery() = Unit

app/src/main/res/layout/activity_gradient.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@
77
android:layout_height="match_parent"
88
tools:context=".GradientActivity">
99

10-
1110
<info.appdev.charting.charts.LineChart
12-
android:id="@+id/chart"
11+
android:id="@+id/chart1"
1312
android:layout_width="0dp"
1413
android:layout_height="0dp"
1514
android:layout_margin="16dp"

0 commit comments

Comments
 (0)