Skip to content

Commit eef0f7c

Browse files
authored
Merge pull request #604 from AppDevNext/LegendNonNull
Legend non null
2 parents a8624fa + 100bf7c commit eef0f7c

44 files changed

Lines changed: 231 additions & 254 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class AnotherBarActivity : DemoBase(), OnSeekBarChangeListener {
5555
// add a nice and smooth animation
5656
binding.chart1.animateY(1500)
5757

58-
binding.chart1.legend?.isEnabled = false
58+
binding.chart1.legend.isEnabled = false
5959
}
6060

6161
override fun onProgressChanged(seekBar: SeekBar?, progress: Int, fromUser: Boolean) {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ class BarChartActivity : DemoBase(), OnSeekBarChangeListener, OnChartValueSelect
9393
rightAxis.spaceTop = 15f
9494
rightAxis.axisMinimum = 0f// this replaces setStartAtZero(true)
9595

96-
binding.chart1.legend?.apply {
96+
binding.chart1.legend.apply {
9797
verticalAlignment = Legend.LegendVerticalAlignment.BOTTOM
9898
horizontalAlignment = Legend.LegendHorizontalAlignment.LEFT
9999
orientation = Legend.LegendOrientation.HORIZONTAL

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class BarChartActivityMultiDataset : DemoBase(), OnSeekBarChangeListener, OnChar
6565
binding.seekBarX.progress = 10
6666
binding.seekBarY.progress = 100
6767

68-
binding.chart1.legend?.apply {
68+
binding.chart1.legend.apply {
6969
verticalAlignment = Legend.LegendVerticalAlignment.TOP
7070
horizontalAlignment = Legend.LegendHorizontalAlignment.RIGHT
7171
orientation = Legend.LegendOrientation.VERTICAL

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ class BarChartActivitySinus : DemoBase(), OnSeekBarChangeListener {
7272
binding.seekbarValues.setOnSeekBarChangeListener(this)
7373
binding.seekbarValues.progress = 150 // set data
7474

75-
binding.chart1.legend?.apply {
75+
binding.chart1.legend.apply {
7676
verticalAlignment = Legend.LegendVerticalAlignment.BOTTOM
7777
horizontalAlignment = Legend.LegendHorizontalAlignment.LEFT
7878
orientation = Legend.LegendOrientation.HORIZONTAL

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ class BarChartPositiveNegative : DemoBase() {
6767
left.zeroLineColor = Color.GRAY
6868
left.zeroLineWidth = 0.7f
6969
binding.chart1.axisRight.isEnabled = false
70-
binding.chart1.legend?.isEnabled = false
70+
binding.chart1.legend.isEnabled = false
7171

7272
// THIS IS THE ORIGINAL DATA YOU WANT TO PLOT
7373
val data: MutableList<Data> = ArrayList()

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class BubbleChartActivity : DemoBase(), OnSeekBarChangeListener, OnChartValueSel
5454
binding.seekBarX.progress = 10
5555
binding.seekBarY.progress = 50
5656

57-
binding.chart1.legend?.apply {
57+
binding.chart1.legend.apply {
5858
verticalAlignment = Legend.LegendVerticalAlignment.TOP
5959
horizontalAlignment = Legend.LegendHorizontalAlignment.RIGHT
6060
orientation = Legend.LegendOrientation.VERTICAL

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ class CandleStickChartActivity : DemoBase(), OnSeekBarChangeListener {
6363
binding.seekBarX.progress = 40
6464
binding.seekBarY.progress = 100
6565

66-
binding.chart1.legend?.isEnabled = false
66+
binding.chart1.legend.isEnabled = false
6767
}
6868

6969
override fun onProgressChanged(seekBar: SeekBar?, progress: Int, fromUser: Boolean) {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class CombinedChartActivity : DemoBase() {
5555
DrawOrder.BAR, DrawOrder.BUBBLE, DrawOrder.CANDLE, DrawOrder.LINE, DrawOrder.SCATTER
5656
)
5757

58-
binding.chart1.legend?.apply {
58+
binding.chart1.legend.apply {
5959
isWordWrapEnabled = true
6060
verticalAlignment = Legend.LegendVerticalAlignment.BOTTOM
6161
horizontalAlignment = Legend.LegendHorizontalAlignment.CENTER

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ class CubicLineChartActivity : DemoBase(), OnSeekBarChangeListener {
7474
binding.seekBarX.progress = 45
7575
binding.seekBarY.progress = 100
7676

77-
binding.chart1.legend?.isEnabled = false
77+
binding.chart1.legend.isEnabled = false
7878

7979
binding.chart1.animateXY(2000, 2000)
8080

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class DrawChartActivity : DemoBase(), OnChartValueSelectedListener, OnDrawListen
4949
val yl = binding.chart1.axisLeft
5050
yl.typeface = tfRegular
5151

52-
binding.chart1.legend?.isEnabled = false
52+
binding.chart1.legend.isEnabled = false
5353

5454
// chart.setYRange(-40f, 40f, true);
5555
// call this to reset the changed y-range

0 commit comments

Comments
 (0)