Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Heatmap gives error if all datapoints are 0 #11

Open
AkhileshManda opened this issue Oct 25, 2022 · 3 comments
Open

Heatmap gives error if all datapoints are 0 #11

AkhileshManda opened this issue Oct 25, 2022 · 3 comments

Comments

@AkhileshManda
Copy link

image

@eterniter06
Copy link

Does this issue persist or was this patched?

@johnshiver
Copy link

still an issue for me

@johnshiver
Copy link

this is how I get around it

        // BUG: avoiding all 0 bug in flutter heatmap
        // https://github.com/devappmin/flutter_heatmap_calendar/issues/11
        bool allZero = records.values.every((value) => value == 0);
        Color color;
        if (allZero) {
          //  change all values to 1, because all zeros breaks
          //  we'll set color to white so it looks empty
          color = Colors.white;
          records = records.map((key, value) => MapEntry(key, 1));
        } else {
          // Otherwise, set the color to red
          color = Colors.red;
        }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants