Skip to content

Commit

Permalink
Implementing fixed tooltip and hide Details Labels (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
rodiguif authored and tiagogoncalves committed Dec 20, 2019
1 parent 1be74a0 commit f90e1e4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ class MainExample : AppCompatActivity() {
forecastedLine.color, forecastedLine.forecasted)
endDateBar(endDateBar.x, endDateBar.y)
unit("")
detailsEnable(true)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class ForecastChartComponent(context: Context) : LinearLayout(context), Anvil.Re
private var endDateData: BarEntry = emptyBar()
private var unit: String = ""
private var zoomEnabled: Boolean = false
private var detailsEnable: Boolean = false

public override fun onAttachedToWindow() {
super.onAttachedToWindow()
Expand All @@ -52,7 +53,9 @@ class ForecastChartComponent(context: Context) : LinearLayout(context), Anvil.Re
size(MATCH, MATCH)
orientation(VERTICAL)

renderDetailsLayout()
if(detailsEnable) {
renderDetailsLayout()
}
renderChart()
}
}
Expand Down Expand Up @@ -183,4 +186,8 @@ class ForecastChartComponent(context: Context) : LinearLayout(context), Anvil.Re
fun zoomEnabled(zoomEnabled: Boolean){
this.zoomEnabled = zoomEnabled
}

fun detailsEnable(detailsEnable: Boolean){
this.detailsEnable = detailsEnable
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,5 @@ object SetupChart{
combinedChart.marker = marker
combinedChart.extraLeftOffset = SIDE_OFFSET
combinedChart.extraRightOffset = SIDE_OFFSET

combinedChart.setOnClickListener {
combinedChart.highlightValue(null)
}
}
}

0 comments on commit f90e1e4

Please sign in to comment.