From 47d5264bea95313919a2b413c904329b8261bdeb Mon Sep 17 00:00:00 2001 From: Rodrigo Ferreira Date: Tue, 13 Jul 2021 10:54:04 -0300 Subject: [PATCH] empty date fix --- .../com/oxeanbits/forecastchart/ui/MainExample.kt | 12 ++++++++++++ .../ui/component/ForecastChartComponent.kt | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/oxeanbits/forecastchart/ui/MainExample.kt b/app/src/main/java/com/oxeanbits/forecastchart/ui/MainExample.kt index 82846eb..68c338d 100644 --- a/app/src/main/java/com/oxeanbits/forecastchart/ui/MainExample.kt +++ b/app/src/main/java/com/oxeanbits/forecastchart/ui/MainExample.kt @@ -58,6 +58,18 @@ class MainExample : AppCompatActivity() { decimalFormat(SetupChartExample.getDecimalFormat()) detailsEnable(true) } + + forecastChartComponent{ + size(MATCH, 350) + expectedLine(expectedLine.values, expectedLine.label, + expectedLine.color, expectedLine.forecasted) + actualLine(actualLine.values, actualLine.label, + actualLine.color, actualLine.forecasted) + forecastedLine(forecastedLine.values, forecastedLine.label, + forecastedLine.color, forecastedLine.forecasted) + unit("m³") + zoomEnabled(true) + } } } } diff --git a/core/src/main/java/com/oxeanbits/forecastchart/ui/component/ForecastChartComponent.kt b/core/src/main/java/com/oxeanbits/forecastchart/ui/component/ForecastChartComponent.kt index e95149f..806d2b3 100644 --- a/core/src/main/java/com/oxeanbits/forecastchart/ui/component/ForecastChartComponent.kt +++ b/core/src/main/java/com/oxeanbits/forecastchart/ui/component/ForecastChartComponent.kt @@ -154,7 +154,7 @@ class ForecastChartComponent(context: Context) : LinearLayoutComponent(context) } private fun emptyBar(): Bar { - return Bar(listOf(BarEntry(-1f, 0f)), "", RED) + return Bar(listOf(), "", 0) } fun expectedLine(arrayData: List, label: String,