@@ -17,7 +17,6 @@ npm i date-activity-graph
1717
1818![ image] ( https://user-images.githubusercontent.com/41127847/118047027-74175400-b37a-11eb-848d-65a0e954b90c.png )
1919
20-
2120### ✨Basic
2221
2322The only thing you need is to provide an array with objects having a date and the amount of hits (this will determine the color).
@@ -75,6 +74,7 @@ interface DateActivityGraphProps {
7574` ` `
7675
7776The DateGraphColor type has this structure:
77+
7878` ` ` ts
7979type DateGraphColor = {
8080 amount: number;
@@ -102,11 +102,10 @@ const Root: React.FC = () => {
102102import DateActivityGraph from "date-activity-graph";
103103
104104const Root: React.FC = () => {
105-
106- const colors: DateGraphColor [] = [
107- { amount: 5 , color: " blue" },
108- { amount: 10 , color: " red" },
109- ];
105+ const colors: DateGraphColor[] = [
106+ { amount: 5, color: "blue" },
107+ { amount: 10, color: "red" },
108+ ];
110109
111110 return (
112111 <DateActivityGraph defaultColor="yellow" colors={colors} data={nodedata} />
@@ -120,12 +119,9 @@ const colors: DateGraphColor[] = [
120119import DateActivityGraph from "date-activity-graph";
121120
122121const Root: React.FC = () => {
122+ const labels: string[] = ["hit", "hits"]; // The first one will occur when the day only has one hit
123123
124- const labels: string [] = [" hit" , " hits" ] // The first one will occur when the day only has one hit
125-
126- return (
127- <DateActivityGraph tooltipLabelNames = { labels } data = { nodedata } />
128- );
124+ return <DateActivityGraph tooltipLabelNames={labels} data={nodedata} />;
129125};
130126` ` `
131127
0 commit comments