Search in sources :

Example 1 with Chart

use of io.swagger.client.model.Chart in project android-client by GenesisVision.

the class ProfitChartView method setChart.

public void setChart(List<Chart> charts) {
    if (charts.isEmpty()) {
        chart.clear();
        return;
    }
    List<Entry> lineEntries = new ArrayList<>();
    // List<BarEntry> barEntries = new ArrayList<>();
    float index = 0;
    for (Chart chart : charts) {
        lineEntries.add(new Entry(index, chart.getTotalProfit().floatValue()));
        // barEntries.add(new BarEntry(index, new float[]{
        // chart.getManagerFund().floatValue() + chart.getInvestorFund().floatValue(),
        // chart.getLoss().floatValue(),
        // chart.getProfit().floatValue()}));
        index++;
    }
    CombinedData data = new CombinedData();
    data.setData(getLineData(lineEntries));
    // data.setData(getBarData(barEntries));
    chart.setData(data);
}
Also used : Entry(com.github.mikephil.charting.data.Entry) BarEntry(com.github.mikephil.charting.data.BarEntry) ArrayList(java.util.ArrayList) CombinedData(com.github.mikephil.charting.data.CombinedData) Chart(io.swagger.client.model.Chart) CombinedChart(com.github.mikephil.charting.charts.CombinedChart)

Aggregations

CombinedChart (com.github.mikephil.charting.charts.CombinedChart)1 BarEntry (com.github.mikephil.charting.data.BarEntry)1 CombinedData (com.github.mikephil.charting.data.CombinedData)1 Entry (com.github.mikephil.charting.data.Entry)1 Chart (io.swagger.client.model.Chart)1 ArrayList (java.util.ArrayList)1