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 @@ -129,15 +129,13 @@ class LineChartActivity : DemoBase(), OnSeekBarChangeListener, OnChartValueSelec
// add data
binding.seekBarX.progress = 45
binding.seekBarY.progress = 180
Timber.d("count=45 range=180f")
setData(this, binding.chart1, 45, 180f)

// draw points over time
binding.chart1.animateX(1500)

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

override fun onCreateOptionsMenu(menu: Menu): Boolean {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ class LineChartActivityColored : DemoBase() {
chart.animateX(2500)
}

@Suppress("SameParameterValue")
private fun getData(range: Float): LineData {
val count = 36
val values = ArrayList<Entry>()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -491,10 +491,11 @@ open class LineChartRenderer(

val trans = dataProvider.getTransformer(dataSet.axisDependency)

// make sure the values do not interfear with the circles
// make sure the values do not interfere with the circles
var valOffset = (dataSet.circleRadius * 1.75f).toInt()

if (!dataSet.isDrawCirclesEnabled) valOffset = valOffset / 2
if (!dataSet.isDrawCirclesEnabled)
valOffset /= 2

xBounds.set(dataProvider, dataSet)

Expand Down Expand Up @@ -534,7 +535,7 @@ open class LineChartRenderer(

icon?.let {
canvas.drawImage(
it,
icon,
(x + iconsOffset.x).toInt(),
(y + iconsOffset.y).toInt()
)
Expand Down
Loading