parent
301cd78d85
commit
dd7c821f45
@ -1,30 +0,0 @@ |
|||||||
package net.pokeranalytics.android.ui.graph |
|
||||||
|
|
||||||
import android.content.Context |
|
||||||
import com.github.mikephil.charting.data.Entry |
|
||||||
import com.github.mikephil.charting.data.LineDataSet |
|
||||||
import net.pokeranalytics.android.R |
|
||||||
|
|
||||||
class PALineDataSet(yVals: List<Entry>, label: String, context: Context) : LineDataSet(yVals, label) { |
|
||||||
|
|
||||||
init { |
|
||||||
this.highLightColor = context.getColor(R.color.chart_highlight_indicator) |
|
||||||
this.setDrawValues(false) |
|
||||||
this.setDrawCircles(false) |
|
||||||
|
|
||||||
val colors = arrayOf(R.color.green_light).toIntArray() |
|
||||||
this.setColors(colors, context) |
|
||||||
|
|
||||||
} |
|
||||||
|
|
||||||
} |
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//class PABarDataSet(yVals: List<BarEntry>, label: String, context: Context) : BarDataSet(yVals, label) { |
|
||||||
// |
|
||||||
// init { |
|
||||||
// this.highLightColor = context.getColor(R.color.chart_highlight_indicator) |
|
||||||
// } |
|
||||||
// |
|
||||||
//} |
|
||||||
@ -0,0 +1,38 @@ |
|||||||
|
package net.pokeranalytics.android.ui.graph |
||||||
|
|
||||||
|
import android.content.Context |
||||||
|
import com.github.mikephil.charting.data.BarDataSet |
||||||
|
import com.github.mikephil.charting.data.BarEntry |
||||||
|
import com.github.mikephil.charting.data.Entry |
||||||
|
import com.github.mikephil.charting.data.LineDataSet |
||||||
|
import net.pokeranalytics.android.R |
||||||
|
|
||||||
|
class DataSetFactory { |
||||||
|
|
||||||
|
companion object { |
||||||
|
|
||||||
|
fun lineDataSetInstance(yVals: List<Entry>, label: String, context: Context) : LineDataSet { |
||||||
|
|
||||||
|
val lineDataSet = LineDataSet(yVals, label) |
||||||
|
lineDataSet.highLightColor = context.getColor(R.color.chart_highlight_indicator) |
||||||
|
lineDataSet.setDrawValues(false) |
||||||
|
lineDataSet.setDrawCircles(false) |
||||||
|
|
||||||
|
val colors = arrayOf(R.color.green_light).toIntArray() |
||||||
|
lineDataSet.setColors(colors, context) |
||||||
|
|
||||||
|
return lineDataSet |
||||||
|
} |
||||||
|
|
||||||
|
fun barDataSetInstance(entries: List<BarEntry>, label: String, context: Context) : BarDataSet { |
||||||
|
|
||||||
|
val barDataSet = BarDataSet(entries, label) |
||||||
|
barDataSet.color = context.getColor(R.color.chart_bar) |
||||||
|
barDataSet.highLightColor = context.getColor(R.color.chart_selected_bar) |
||||||
|
barDataSet.setDrawValues(false) |
||||||
|
return barDataSet |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
Loading…
Reference in new issue