Skip to content
Snippets Groups Projects
Commit 2acfebbe authored by Sara Savanovic Djordjevic's avatar Sara Savanovic Djordjevic
Browse files

update: add test bar chart data

parent b7c32fb3
No related branches found
No related tags found
No related merge requests found
import 'dart:math';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:fl_chart/fl_chart.dart'; import 'package:fl_chart/fl_chart.dart';
...@@ -28,12 +29,24 @@ class _BarDataState extends State<BarData> { ...@@ -28,12 +29,24 @@ class _BarDataState extends State<BarData> {
for (int i = 0; i < 7; i++) { for (int i = 0; i < 7; i++) {
var entry = selectedSubDiv?.iceStats[i]; var entry = selectedSubDiv?.iceStats[i];
if (entry != null) { if (entry != null) {
// NB test data for demo
Random random = Random();
double blackIce = 2.0 + random.nextDouble() * (4.0 - 2.0);
double slushIce = 1.0 + random.nextDouble() * (1.5 - 1.0);
double snowDepth = random.nextDouble() * 1.3;
barData[i] = [ barData[i] = [
entry.blackIce, //entry.blackIce,
entry.slushIce, //entry.slushIce,
entry.snowDepth, //entry.snowDepth,
blackIce, // NB test data for demo
slushIce, // ...
snowDepth, // ..
]; ];
// NB test data for demo
totalHeight = blackIce + slushIce + snowDepth + 0.3; // NB demo data
// Find tallest layer // Find tallest layer
if (entry.totalIce > totalHeight) { if (entry.totalIce > totalHeight) {
totalHeight = entry.totalIce; totalHeight = entry.totalIce;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment