|
|
|
|
@ -35,7 +35,7 @@ fun BarLineChartBase<*>.setStyle( |
|
|
|
|
this.xAxis.granularity = 1.0f |
|
|
|
|
this.xAxis.textColor = ContextCompat.getColor(context, R.color.chart_default) |
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
try { // can crash for unknown reasons, same below for Y axis |
|
|
|
|
val font = ResourcesCompat.getFont(context, R.font.roboto_medium) |
|
|
|
|
this.xAxis.typeface = font |
|
|
|
|
} catch (e: Resources.NotFoundException) { |
|
|
|
|
@ -47,12 +47,8 @@ fun BarLineChartBase<*>.setStyle( |
|
|
|
|
this.xAxis.isEnabled = true |
|
|
|
|
|
|
|
|
|
when (this) { |
|
|
|
|
is BarChart -> { |
|
|
|
|
this.xAxis.setDrawLabels(false) |
|
|
|
|
} |
|
|
|
|
else -> { |
|
|
|
|
this.xAxis.setDrawLabels(true) |
|
|
|
|
} |
|
|
|
|
is BarChart -> this.xAxis.setDrawLabels(false) |
|
|
|
|
else -> this.xAxis.setDrawLabels(true) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Y Axis |
|
|
|
|
@ -67,7 +63,14 @@ fun BarLineChartBase<*>.setStyle( |
|
|
|
|
this.axisLeft.granularity = 1.0f |
|
|
|
|
|
|
|
|
|
this.axisLeft.textColor = ContextCompat.getColor(context, R.color.chart_default) |
|
|
|
|
this.axisLeft.typeface = ResourcesCompat.getFont(context, R.font.roboto_medium) |
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
val font = ResourcesCompat.getFont(context, R.font.roboto_medium) |
|
|
|
|
this.axisLeft.typeface = font |
|
|
|
|
} catch (e: Resources.NotFoundException) { |
|
|
|
|
Crashlytics.log(e.message) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
this.axisLeft.labelCount = |
|
|
|
|
if (small) 1 else 7 // @todo not great if interval is [0..2] for number of records as we get decimals |
|
|
|
|
this.axisLeft.textSize = 12f |
|
|
|
|
|