Open randomor opened 4 years ago
@randomor it can be easily fixed by
const diff = (in_max - in_min) || 1;
return ((x - in_min) * (out_max - out_min)) / diff + out_min;
Not for self-promotion, if you want to use heat-map solely for this repo, probably you can test out my fork, I recently go through the heatmap code and the core abstract-chart.js
. Found a lot of hardcode number and some shared style
abusing #345 . And it becomes a pain to use.
So I basically reenginner many of them and modify position calculation to make the calculation straight and intuitive. <BarChart>
and <ContributionGraph>
are now fully dynamic and responsive. ReadMe.md
was updated as well for those changes.
<LineChart>
and <StackedBar>
are surely broken under my fork.
I probably PR my fork to main as a proposal or suggestion even I fixed all of them, since it will likely break the original use, depending on how heavily the issue properties are abused.
https://github.com/indiespirit/react-native-chart-kit/blob/c45694639cf5fcbec3a5630841059b973bdbb523/src/contribution-graph/index.js#L22
I'm using
ContributionGraph
only but this might also affect other charts.