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,