package com.casic.br.view.home

import com.casic.br.R
import com.casic.br.utils.ChartViewHelper
import com.github.mikephil.charting.data.PieEntry
import com.gyf.immersionbar.ImmersionBar
import com.pengxh.kt.lite.base.KotlinBaseActivity
import com.pengxh.kt.lite.extensions.convertColor
import com.pengxh.kt.lite.utils.ImmerseStatusBarUtil
import kotlinx.android.synthetic.main.activity_gas_analysis.*
import kotlinx.android.synthetic.main.include_base_title.*
import java.util.*

class GasAnalysisActivity : KotlinBaseActivity() {

    override fun initLayoutView(): Int = R.layout.activity_gas_analysis

    override fun observeRequestState() {

    }

    override fun setupTopBarLayout() {
        ImmersionBar.with(this).statusBarDarkFont(true).init()
        ImmerseStatusBarUtil.setColor(this, R.color.white.convertColor(this))

        leftBackView.setOnClickListener { finish() }
        titleView.text = "用气分析"
    }

    override fun initData() {
        val pieEntries: MutableList<PieEntry> = ArrayList()
        //饼图
        pieEntries.add(PieEntry(15f, "第一季度"))
        pieEntries.add(PieEntry(45f, "第二季度"))
        pieEntries.add(PieEntry(25f, "第三季度"))
        pieEntries.add(PieEntry(25f, "第四季度"))
        ChartViewHelper.setPieChartData(gasPieChart, pieEntries)
    }

    override fun initEvent() {

    }
}