indiespirit / react-native-chart-kit

📊React Native Chart Kit: Line Chart, Bezier Line Chart, Progress Ring, Bar chart, Pie chart, Contribution graph (heatmap)
https://expo.io/@indiespirit/react-native-chart-kit
MIT License
2.85k stars 658 forks source link

ContributionChartValue should have `count` property or dynamic via accessor #702

Open abhidatta0 opened 1 year ago

abhidatta0 commented 1 year ago

There is a weak TS support when writing logic on the tooltipDataAttrs value param. Currently this is the structure:

type ContributionChartValue = {
    value: number;
    title: string;
    tooltipDataAttrs: TooltipDataAttrs;
    date: Date;
};

This is different from what we actually find by logging the value (as per the values data in the example)

{"value": {"count": 4, "date": "2017-04-02"}}
{"value": {"count": null, "date": null}}