mirror of
https://github.com/dzeiocom/OpenHealth.git
synced 2025-04-23 03:12:14 +00:00
fix: chart distances
This commit is contained in:
parent
0e4e24ac67
commit
1aa7f2d89e
@ -169,7 +169,7 @@ kapt {
|
|||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
// Dzeio Charts
|
// Dzeio Charts
|
||||||
implementation("com.dzeio:charts:0.1.6")
|
implementation("com.dzeio:charts:0.1.7")
|
||||||
|
|
||||||
// Dzeio Crash Handler
|
// Dzeio Crash Handler
|
||||||
implementation("com.dzeio:crashhandler:1.0.1")
|
implementation("com.dzeio:crashhandler:1.0.1")
|
||||||
|
@ -96,6 +96,9 @@ class HomeFragment : BaseFragment<HomeViewModel, FragmentHomeBinding>(HomeViewMo
|
|||||||
|
|
||||||
binding.weightGraph.apply {
|
binding.weightGraph.apply {
|
||||||
val serie = LineSerie(this)
|
val serie = LineSerie(this)
|
||||||
|
animator.enabled = false
|
||||||
|
xAxis.dataWidth = 2.4192e+9
|
||||||
|
xAxis.scrollEnabled = true
|
||||||
ChartUtils.materielTheme(this, requireView())
|
ChartUtils.materielTheme(this, requireView())
|
||||||
series = arrayListOf(serie)
|
series = arrayListOf(serie)
|
||||||
}
|
}
|
||||||
@ -181,7 +184,7 @@ class HomeFragment : BaseFragment<HomeViewModel, FragmentHomeBinding>(HomeViewMo
|
|||||||
if (list.isEmpty()) {
|
if (list.isEmpty()) {
|
||||||
chart.xAxis.x = 0.0
|
chart.xAxis.x = 0.0
|
||||||
} else {
|
} else {
|
||||||
chart.xAxis.x = list[0].timestamp.toDouble()
|
chart.xAxis.x = list.last().timestamp - chart.xAxis.dataWidth!!
|
||||||
}
|
}
|
||||||
|
|
||||||
chart.refresh()
|
chart.refresh()
|
||||||
|
@ -178,8 +178,10 @@ class ListWeightFragment :
|
|||||||
|
|
||||||
chart.apply {
|
chart.apply {
|
||||||
series = arrayListOf(serie)
|
series = arrayListOf(serie)
|
||||||
|
animator.enabled = false
|
||||||
|
|
||||||
yAxis.apply {
|
yAxis.apply {
|
||||||
|
setYMin(null)
|
||||||
textLabel.color = MaterialColors.getColor(
|
textLabel.color = MaterialColors.getColor(
|
||||||
requireView(),
|
requireView(),
|
||||||
com.google.android.material.R.attr.colorOnPrimaryContainer
|
com.google.android.material.R.attr.colorOnPrimaryContainer
|
||||||
@ -194,6 +196,8 @@ class ListWeightFragment :
|
|||||||
|
|
||||||
xAxis.apply {
|
xAxis.apply {
|
||||||
// 7 day history
|
// 7 day history
|
||||||
|
dataWidth = 6.048e+8 * 4
|
||||||
|
scrollEnabled = true
|
||||||
textPaint.color = MaterialColors.getColor(
|
textPaint.color = MaterialColors.getColor(
|
||||||
requireView(),
|
requireView(),
|
||||||
com.google.android.material.R.attr.colorOnPrimaryContainer
|
com.google.android.material.R.attr.colorOnPrimaryContainer
|
||||||
@ -247,7 +251,7 @@ class ListWeightFragment :
|
|||||||
if (list.isEmpty()) {
|
if (list.isEmpty()) {
|
||||||
chart.xAxis.x = 0.0
|
chart.xAxis.x = 0.0
|
||||||
} else {
|
} else {
|
||||||
chart.xAxis.x = list[0].timestamp.toDouble()
|
chart.xAxis.x = list.last().timestamp - chart.xAxis.dataWidth!!
|
||||||
}
|
}
|
||||||
|
|
||||||
chart.refresh()
|
chart.refresh()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user