Ngx-charts: Calendar Heatmap cell coloring is not working

Created on 17 Jul 2019  路  1Comment  路  Source: swimlane/ngx-charts

Describe the bug
A clear and concise description of what the bug is.
I copied all the source code that are related to the calendar heatmap. I was able to display the chart, but all the cell colors are the same even though they have different values.

To Reproduce
Steps to reproduce the behavior:

Take a look at this StackBlitz: https://stackblitz.com/edit/angular-642xtv

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.
image

Demo
Provide an online demo (stackblitz, codesandbox, or similar) where the issue can be reproduced

Take a look at this StackBlitz: https://stackblitz.com/edit/angular-642xtv

ngx-charts version
Specify the version of ngx-charts where this bug is present
12.0.1

Additional context
Add any other context about the problem here.

Bug

Most helpful comment

Your [max] input on the heatmap component is set to 50,000, while the max value in your data is 12. This is why all the colors you get are from the very beginning of your color scale, and they all end up similar.

If you change the max input to the maximum value of your data, your colors will span the full range of the color scale. Example:

https://stackblitz.com/edit/angular-il9lf4?file=src/app/app.component.ts

image

>All comments

Your [max] input on the heatmap component is set to 50,000, while the max value in your data is 12. This is why all the colors you get are from the very beginning of your color scale, and they all end up similar.

If you change the max input to the maximum value of your data, your colors will span the full range of the color scale. Example:

https://stackblitz.com/edit/angular-il9lf4?file=src/app/app.component.ts

image

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jvbianchi picture jvbianchi  路  4Comments

DZDomi picture DZDomi  路  4Comments

tobigit picture tobigit  路  4Comments

ronybarbosa picture ronybarbosa  路  3Comments

lokeshdaiya picture lokeshdaiya  路  3Comments