|
|
|
@ -1,8 +1,10 @@ |
|
|
|
package net.pokeranalytics.android.ui.graph |
|
|
|
package net.pokeranalytics.android.ui.graph |
|
|
|
|
|
|
|
|
|
|
|
import android.content.Context |
|
|
|
import android.content.Context |
|
|
|
|
|
|
|
import android.content.res.Resources |
|
|
|
import androidx.core.content.ContextCompat |
|
|
|
import androidx.core.content.ContextCompat |
|
|
|
import androidx.core.content.res.ResourcesCompat |
|
|
|
import androidx.core.content.res.ResourcesCompat |
|
|
|
|
|
|
|
import com.crashlytics.android.Crashlytics |
|
|
|
import com.github.mikephil.charting.charts.BarChart |
|
|
|
import com.github.mikephil.charting.charts.BarChart |
|
|
|
import com.github.mikephil.charting.charts.BarLineChartBase |
|
|
|
import com.github.mikephil.charting.charts.BarLineChartBase |
|
|
|
import com.github.mikephil.charting.components.XAxis |
|
|
|
import com.github.mikephil.charting.components.XAxis |
|
|
|
@ -32,7 +34,14 @@ fun BarLineChartBase<*>.setStyle( |
|
|
|
this.xAxis.isGranularityEnabled = true |
|
|
|
this.xAxis.isGranularityEnabled = true |
|
|
|
this.xAxis.granularity = 1.0f |
|
|
|
this.xAxis.granularity = 1.0f |
|
|
|
this.xAxis.textColor = ContextCompat.getColor(context, R.color.chart_default) |
|
|
|
this.xAxis.textColor = ContextCompat.getColor(context, R.color.chart_default) |
|
|
|
this.xAxis.typeface = ResourcesCompat.getFont(context, R.font.roboto_medium) |
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
val font = ResourcesCompat.getFont(context, R.font.roboto_medium) |
|
|
|
|
|
|
|
this.xAxis.typeface = font |
|
|
|
|
|
|
|
} catch (e: Resources.NotFoundException) { |
|
|
|
|
|
|
|
Crashlytics.log(e.message) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
this.xAxis.labelCount = 4 |
|
|
|
this.xAxis.labelCount = 4 |
|
|
|
this.xAxis.textSize = 12f |
|
|
|
this.xAxis.textSize = 12f |
|
|
|
this.xAxis.isEnabled = true |
|
|
|
this.xAxis.isEnabled = true |
|
|
|
|