Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class AnotherBarActivity : DemoBase(), OnSeekBarChangeListener {
// add a nice and smooth animation
binding.chart1.animateY(1500)

binding.chart1.legend?.isEnabled = false
binding.chart1.legend.isEnabled = false
}

override fun onProgressChanged(seekBar: SeekBar?, progress: Int, fromUser: Boolean) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ class BarChartActivity : DemoBase(), OnSeekBarChangeListener, OnChartValueSelect
rightAxis.spaceTop = 15f
rightAxis.axisMinimum = 0f// this replaces setStartAtZero(true)

binding.chart1.legend?.apply {
binding.chart1.legend.apply {
verticalAlignment = Legend.LegendVerticalAlignment.BOTTOM
horizontalAlignment = Legend.LegendHorizontalAlignment.LEFT
orientation = Legend.LegendOrientation.HORIZONTAL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class BarChartActivityMultiDataset : DemoBase(), OnSeekBarChangeListener, OnChar
binding.seekBarX.progress = 10
binding.seekBarY.progress = 100

binding.chart1.legend?.apply {
binding.chart1.legend.apply {
verticalAlignment = Legend.LegendVerticalAlignment.TOP
horizontalAlignment = Legend.LegendHorizontalAlignment.RIGHT
orientation = Legend.LegendOrientation.VERTICAL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class BarChartActivitySinus : DemoBase(), OnSeekBarChangeListener {
binding.seekbarValues.setOnSeekBarChangeListener(this)
binding.seekbarValues.progress = 150 // set data

binding.chart1.legend?.apply {
binding.chart1.legend.apply {
verticalAlignment = Legend.LegendVerticalAlignment.BOTTOM
horizontalAlignment = Legend.LegendHorizontalAlignment.LEFT
orientation = Legend.LegendOrientation.HORIZONTAL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class BarChartPositiveNegative : DemoBase() {
left.zeroLineColor = Color.GRAY
left.zeroLineWidth = 0.7f
binding.chart1.axisRight.isEnabled = false
binding.chart1.legend?.isEnabled = false
binding.chart1.legend.isEnabled = false

// THIS IS THE ORIGINAL DATA YOU WANT TO PLOT
val data: MutableList<Data> = ArrayList()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class BubbleChartActivity : DemoBase(), OnSeekBarChangeListener, OnChartValueSel
binding.seekBarX.progress = 10
binding.seekBarY.progress = 50

binding.chart1.legend?.apply {
binding.chart1.legend.apply {
verticalAlignment = Legend.LegendVerticalAlignment.TOP
horizontalAlignment = Legend.LegendHorizontalAlignment.RIGHT
orientation = Legend.LegendOrientation.VERTICAL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class CandleStickChartActivity : DemoBase(), OnSeekBarChangeListener {
binding.seekBarX.progress = 40
binding.seekBarY.progress = 100

binding.chart1.legend?.isEnabled = false
binding.chart1.legend.isEnabled = false
}

override fun onProgressChanged(seekBar: SeekBar?, progress: Int, fromUser: Boolean) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class CombinedChartActivity : DemoBase() {
DrawOrder.BAR, DrawOrder.BUBBLE, DrawOrder.CANDLE, DrawOrder.LINE, DrawOrder.SCATTER
)

binding.chart1.legend?.apply {
binding.chart1.legend.apply {
isWordWrapEnabled = true
verticalAlignment = Legend.LegendVerticalAlignment.BOTTOM
horizontalAlignment = Legend.LegendHorizontalAlignment.CENTER
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class CubicLineChartActivity : DemoBase(), OnSeekBarChangeListener {
binding.seekBarX.progress = 45
binding.seekBarY.progress = 100

binding.chart1.legend?.isEnabled = false
binding.chart1.legend.isEnabled = false

binding.chart1.animateXY(2000, 2000)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class DrawChartActivity : DemoBase(), OnChartValueSelectedListener, OnDrawListen
val yl = binding.chart1.axisLeft
yl.typeface = tfRegular

binding.chart1.legend?.isEnabled = false
binding.chart1.legend.isEnabled = false

// chart.setYRange(-40f, 40f, true);
// call this to reset the changed y-range
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class FilledLineActivity : DemoBase() {
// if disabled, scaling can be done on x- and y-axis separately
binding.chart1.setPinchZoom(false)

binding.chart1.legend?.apply {
binding.chart1.legend.apply {
isEnabled = false
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class GradientActivity : DemoBase() {

// Minimal chart setup
chart.description?.isEnabled = false
chart.legend?.isEnabled = false
chart.legend.isEnabled = false
chart.axisRight.isEnabled = false
chart.setDrawGridBackground(false)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class HalfPieChartActivity : DemoBase() {

binding.chart1.animateY(1400, Easing.easeInOutQuad)

binding.chart1.legend?.apply {
binding.chart1.legend.apply {
verticalAlignment = Legend.LegendVerticalAlignment.TOP
horizontalAlignment = Legend.LegendHorizontalAlignment.CENTER
orientation = Legend.LegendOrientation.HORIZONTAL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ class HorizontalBarChartActivity : DemoBase(), OnSeekBarChangeListener, OnChartV
binding.seekBarY.progress = 50
binding.seekBarX.progress = 12

binding.chart1.legend?.apply {
binding.chart1.legend.apply {
verticalAlignment = Legend.LegendVerticalAlignment.BOTTOM
horizontalAlignment = Legend.LegendHorizontalAlignment.LEFT
orientation = Legend.LegendOrientation.HORIZONTAL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class HorizontalBarNegativeChartActivity : DemoBase(), OnSeekBarChangeListener,
binding.seekBarY.progress = 50
binding.seekBarX.progress = 12

binding.chart1.legend?.apply {
binding.chart1.legend.apply {
verticalAlignment = Legend.LegendVerticalAlignment.BOTTOM
horizontalAlignment = Legend.LegendHorizontalAlignment.LEFT
orientation = Legend.LegendOrientation.HORIZONTAL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class InvertedLineChartActivity : DemoBase(), OnSeekBarChangeListener, OnChartVa
// chart.centerViewPort(10, 50);

// get the legend (only possible after setting data)
binding.chart1.legend?.apply {
binding.chart1.legend.apply {
form = LegendForm.LINE
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ class LineChartActivity : DemoBase(), OnSeekBarChangeListener, OnChartValueSelec

// get the legend (only possible after setting data)
val legend = binding.chart1.legend
legend?.form = LegendForm.LINE
legend.form = LegendForm.LINE
}

override fun onCreateOptionsMenu(menu: Menu): Boolean {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class LineChartActivityColored : DemoBase() {
chart.setData(data)

// get the legend (only possible after setting data)
chart.legend?.apply {
chart.legend.apply {
isEnabled = false
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class LineChartDualAxisActivity : DemoBase(), OnSeekBarChangeListener, OnChartVa
binding.chart1.animateX(1500)

// get the legend (only possible after setting data)
binding.chart1.legend?.apply {
binding.chart1.legend.apply {
form = LegendForm.LINE
typeface = tfLight
textSize = 11f
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class LineChartTimeActivity : DemoBase(), OnSeekBarChangeListener {
binding.seekBarX.progress = 100

// get the legend (only possible after setting data)
binding.chart1.legend?.apply {
binding.chart1.legend.apply {
isEnabled = false
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class MultiLineChartActivity : DemoBase(), OnSeekBarChangeListener, OnChartGestu
binding.seekBarX.progress = 20
binding.seekBarY.progress = 100

binding.chart1.legend?.apply {
binding.chart1.legend.apply {
verticalAlignment = Legend.LegendVerticalAlignment.TOP
horizontalAlignment = Legend.LegendHorizontalAlignment.RIGHT
orientation = Legend.LegendOrientation.VERTICAL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class PerformanceLineChart : DemoBase(), OnSeekBarChangeListener {
binding.chart1.setData(data)

// get the legend (only possible after setting data)
binding.chart1.legend?.apply {
binding.chart1.legend.apply {
isEnabled = false
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class PieChartActivity : DemoBase(), OnSeekBarChangeListener, OnChartValueSelect
binding.chart1.animateY(1400, Easing.easeInOutQuad)

// chart.spin(2000, 0, 360);
binding.chart1.legend?.apply {
binding.chart1.legend.apply {
verticalAlignment = Legend.LegendVerticalAlignment.TOP
horizontalAlignment = Legend.LegendHorizontalAlignment.RIGHT
orientation = Legend.LegendOrientation.VERTICAL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class PieChartRoundedActivity : DemoBase(), OnSeekBarChangeListener, OnChartValu
binding.chart1.animateY(1400, Easing.easeInOutQuad)

// chart.spin(2000, 0, 360);
binding.chart1.legend?.apply {
binding.chart1.legend.apply {
verticalAlignment = Legend.LegendVerticalAlignment.TOP
horizontalAlignment = Legend.LegendHorizontalAlignment.RIGHT
orientation = Legend.LegendOrientation.VERTICAL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ class PiePolylineChartActivity : DemoBase(), OnSeekBarChangeListener, OnChartVal
binding.chart1.animateY(1400, Easing.easeInOutQuad)

// chart.spin(2000, 0, 360);
binding.chart1.legend?.apply {
binding.chart1.legend.apply {
verticalAlignment = Legend.LegendVerticalAlignment.TOP
horizontalAlignment = Legend.LegendHorizontalAlignment.RIGHT
orientation = Legend.LegendOrientation.VERTICAL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class RadarChartActivity : DemoBase() {
yAxis.axisMaximum = 80f
yAxis.setDrawLabels(false)

binding.chart1.legend?.apply {
binding.chart1.legend.apply {
verticalAlignment = Legend.LegendVerticalAlignment.TOP
horizontalAlignment = Legend.LegendHorizontalAlignment.CENTER
orientation = Legend.LegendOrientation.HORIZONTAL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class RealtimeLineChartActivity : DemoBase(), OnChartValueSelectedListener {
binding.chart1.setData(data)

// get the legend (only possible after setting data)
binding.chart1.legend?.apply {
binding.chart1.legend.apply {
form = LegendForm.LINE
typeface = tfLight
textColor = Color.WHITE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class ScatterChartActivity : DemoBase(), OnSeekBarChangeListener, OnChartValueSe
binding.seekBarX.progress = 45
binding.seekBarY.progress = 100

binding.chart1.legend?.apply {
binding.chart1.legend.apply {
verticalAlignment = Legend.LegendVerticalAlignment.TOP
horizontalAlignment = Legend.LegendHorizontalAlignment.RIGHT
orientation = Legend.LegendOrientation.VERTICAL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class ScrollViewActivity : DemoBase() {

binding.chart1.axisLeft.setDrawGridLines(false)

binding.chart1.legend?.isEnabled = false
binding.chart1.legend.isEnabled = false

setData(10)
binding.chart1.setFitBars(true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ class SpecificPositionsLineChartActivity : DemoBase(), OnSeekBarChangeListener,
//mChart.invalidate();

// get the legend (only possible after setting data)
binding.chart1.legend?.apply {
binding.chart1.legend.apply {
form = LegendForm.LINE
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class StackedBarActivity : DemoBase(), OnSeekBarChangeListener, OnChartValueSele
binding.seekBarX.progress = 12
binding.seekBarY.progress = 100

binding.chart1.legend?.apply {
binding.chart1.legend.apply {
verticalAlignment = Legend.LegendVerticalAlignment.BOTTOM
horizontalAlignment = Legend.LegendHorizontalAlignment.RIGHT
orientation = Legend.LegendOrientation.HORIZONTAL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class StackedBarActivityNegative : DemoBase(), OnChartValueSelectedListener {
}
}

binding.chart1.legend?.apply {
binding.chart1.legend.apply {
verticalAlignment = Legend.LegendVerticalAlignment.BOTTOM
horizontalAlignment = Legend.LegendHorizontalAlignment.RIGHT
orientation = Legend.LegendOrientation.HORIZONTAL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ class HorizontalBarComposeActivity : DemoBaseCompose() {
chart.setFitBars(true)
chart.animateY(2500)

chart.legend?.apply {
chart.legend.apply {
verticalAlignment = Legend.LegendVerticalAlignment.BOTTOM
horizontalAlignment = Legend.LegendHorizontalAlignment.LEFT
orientation = Legend.LegendOrientation.HORIZONTAL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class BarChartFrag : SimpleFragment(), OnChartGestureListener {

chart!!.setData(generateBarData(1, 20000f))

chart!!.legend?.apply {
chart!!.legend.apply {
typeface = tf
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class ComplexityFragment : SimpleFragment() {

val tf = Typeface.createFromAsset(requireContext().assets, "OpenSans-Light.ttf")

chart!!.legend?.apply {
chart!!.legend.apply {
typeface = tf
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class PieChartFrag : SimpleFragment() {
chart!!.holeRadius = 45f
chart!!.transparentCircleRadius = 50f

chart!!.legend?.apply {
chart!!.legend.apply {
verticalAlignment = Legend.LegendVerticalAlignment.TOP
horizontalAlignment = Legend.LegendHorizontalAlignment.RIGHT
orientation = Legend.LegendOrientation.VERTICAL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class ScatterChartFrag : SimpleFragment() {
rightAxis.typeface = tf
rightAxis.setDrawGridLines(false)

chart!!.legend?.apply {
chart!!.legend.apply {
isWordWrapEnabled = true
typeface = tf
formSize = 14f
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class SineCosineFragment : SimpleFragment() {

val tf = Typeface.createFromAsset(requireContext().assets, "OpenSans-Light.ttf")

chart!!.legend?.apply {
chart!!.legend.apply {
typeface = tf
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class PieChartItem(cd: ChartData<*>, c: Context) : ChartItem(cd) {
chartData.setValueTextSize(11f)
chartData.setValueTextColor(Color.WHITE)
// set data
holder.chart!!.setData(chartData as PieData?)
holder.chart?.setData(chartData as PieData?)

holder.chart?.legend?.apply {
verticalAlignment = Legend.LegendVerticalAlignment.TOP
Expand Down
Loading
Loading