parent
0be3cd5527
commit
e0cbc7b00a
@ -0,0 +1,66 @@ |
|||||||
|
package net.pokeranalytics.android.ui.graph |
||||||
|
|
||||||
|
import com.github.mikephil.charting.charts.BarChart |
||||||
|
import com.github.mikephil.charting.charts.BarLineChartBase |
||||||
|
import com.github.mikephil.charting.charts.LineChart |
||||||
|
|
||||||
|
fun BarChart.setStyle() { |
||||||
|
GraphHelper.setStyle(this) |
||||||
|
} |
||||||
|
|
||||||
|
fun LineChart.setStyle() { |
||||||
|
GraphHelper.setStyle(this) |
||||||
|
} |
||||||
|
|
||||||
|
class GraphHelper { |
||||||
|
|
||||||
|
companion object { |
||||||
|
|
||||||
|
fun setStyle(chart: BarLineChartBase<*>) { |
||||||
|
|
||||||
|
// this.xAxis.axisLineColor = ContextCompat.getColor(context, R.color.) ChartAppearance.defaultColor |
||||||
|
// this.xAxis.axisLineWidth = ChartAppearance.lineWidth |
||||||
|
// this.xAxis.enableGridDashedLine(3.0f, 5.0f, 1.0f) |
||||||
|
// |
||||||
|
// this.xAxis.labelTextColor = ChartAppearance.defaultColor |
||||||
|
// this.xAxis.labelFont = Fonts.graphAxis |
||||||
|
// this.xAxis.labelCount = 4 |
||||||
|
// this.xAxis.labelPosition = .bottom |
||||||
|
// |
||||||
|
// this.xAxis.drawLabelsEnabled = true |
||||||
|
// this.xAxis.drawGridLinesEnabled = true |
||||||
|
// this.xAxis.granularity = 1.0 |
||||||
|
// this.xAxis.granularityEnabled = true |
||||||
|
// this.xAxis.enabled = true |
||||||
|
// |
||||||
|
// // Y Axis |
||||||
|
// this.leftAxis.drawAxisLineEnabled = false |
||||||
|
// this.leftAxis.drawGridLinesEnabled = true |
||||||
|
// this.leftAxis.gridLineDashLengths = [3.0, 5.0] |
||||||
|
// |
||||||
|
// this.leftAxis.drawZeroLineEnabled = true |
||||||
|
// this.leftAxis.zeroLineWidth = ChartAppearance.lineWidth |
||||||
|
// this.leftAxis.zeroLineColor = ChartAppearance.defaultColor |
||||||
|
// |
||||||
|
// this.leftAxis.granularityEnabled = true |
||||||
|
// this.leftAxis.granularity = 1.0 |
||||||
|
// |
||||||
|
// this.leftAxis.labelTextColor = ChartAppearance.defaultColor |
||||||
|
// this.leftAxis.labelFont = Fonts.graphAxis |
||||||
|
// this.leftAxis.labelCount = small ? 1 : 7 // @todo not great if interval is [0..2] for number of records as we get decimals |
||||||
|
// |
||||||
|
// if timeYAxis { |
||||||
|
// this.leftAxis.valueFormatter = HourValueFormatter() |
||||||
|
// } else { |
||||||
|
// this.leftAxis.valueFormatter = LargeNumberFormatter() |
||||||
|
// } |
||||||
|
// |
||||||
|
// this.rightAxis.enabled = false |
||||||
|
// |
||||||
|
// this.legend.enabled = false |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
Loading…
Reference in new issue