|
|
|
|
@ -30,7 +30,7 @@ import java.text.DateFormat |
|
|
|
|
import java.util.* |
|
|
|
|
import kotlin.coroutines.CoroutineContext |
|
|
|
|
|
|
|
|
|
class GraphParameters(var stat: Stat, var report: Report) { |
|
|
|
|
class GraphParameters(var stat: Stat, var computableGroup: ComputableGroup, var report: Report) { |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -40,8 +40,9 @@ class GraphFragment : PokerAnalyticsFragment(), OnChartValueSelectedListener, Co |
|
|
|
|
|
|
|
|
|
private var stat: Stat = Stat.NETRESULT |
|
|
|
|
private var reports: MutableMap<AggregationType, Report> = hashMapOf() |
|
|
|
|
lateinit private var computableGroup: ComputableGroup |
|
|
|
|
|
|
|
|
|
private var selectedReport: Report? = null |
|
|
|
|
lateinit private var selectedReport: Report |
|
|
|
|
|
|
|
|
|
lateinit var legendView: LegendView |
|
|
|
|
lateinit var chartView: BarLineChartBase<*> |
|
|
|
|
@ -55,8 +56,9 @@ class GraphFragment : PokerAnalyticsFragment(), OnChartValueSelectedListener, Co |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
fun setData(stat: Stat, report: Report) { |
|
|
|
|
fun setData(stat: Stat, group: ComputableGroup, report: Report) { |
|
|
|
|
this.stat = stat |
|
|
|
|
this.computableGroup = group |
|
|
|
|
|
|
|
|
|
this.aggregationTypes = stat.aggregationTypes |
|
|
|
|
this.reports[this.aggregationTypes.first()] = report |
|
|
|
|
@ -84,9 +86,7 @@ class GraphFragment : PokerAnalyticsFragment(), OnChartValueSelectedListener, Co |
|
|
|
|
this.legendView = LegendView(requireContext()) |
|
|
|
|
this.legendContainer.addView(this.legendView) |
|
|
|
|
|
|
|
|
|
this.selectedReport?.let { |
|
|
|
|
this.loadGraph(it) |
|
|
|
|
} |
|
|
|
|
this.loadGraph(this.selectedReport) |
|
|
|
|
|
|
|
|
|
this.aggregationTypes.forEach { type -> |
|
|
|
|
val chip = Chip(requireContext()) |
|
|
|
|
@ -127,7 +127,7 @@ class GraphFragment : PokerAnalyticsFragment(), OnChartValueSelectedListener, Co |
|
|
|
|
val realm = Realm.getDefaultInstance() |
|
|
|
|
|
|
|
|
|
val aggregationType = stat.aggregationTypes.first() |
|
|
|
|
// r = Calculator.computeStatsWithEvolutionByAggregationType(realm, computableGroup, aggregationType) |
|
|
|
|
r = Calculator.computeStatsWithEvolutionByAggregationType(realm, computableGroup, aggregationType) |
|
|
|
|
|
|
|
|
|
realm.close() |
|
|
|
|
|
|
|
|
|
|