(username)
| 133 | // Fetch user data and create graph |
| 134 | |
| 135 | const getGraph = (username) => { |
| 136 | // Graph Configuration |
| 137 | |
| 138 | const options = { |
| 139 | height: 380, |
| 140 | axisY: { |
| 141 | title: 'Contributions', |
| 142 | onlyInteger: true, |
| 143 | offset: 70, |
| 144 | labelOffset: { |
| 145 | y: 4.5, |
| 146 | }, |
| 147 | }, |
| 148 | axisX: { |
| 149 | title: 'Days', |
| 150 | offset: 50, |
| 151 | labelOffset: { |
| 152 | x: -4.5, |
| 153 | }, |
| 154 | }, |
| 155 | chartPadding: { |
| 156 | top: 80, |
| 157 | right: 50, |
| 158 | bottom: 20, |
| 159 | left: 20, |
| 160 | }, |
| 161 | showArea: true, |
| 162 | fullWidth: true, |
| 163 | plugins: [ |
| 164 | Chartist.plugins.ctAxisTitle({ |
| 165 | axisX: { |
| 166 | axisTitle: 'Days', |
| 167 | axisClass: 'ct-axis-title', |
| 168 | offset: { |
| 169 | x: 0, |
| 170 | y: 50, |
| 171 | }, |
| 172 | textAnchor: 'middle', |
| 173 | }, |
| 174 | axisY: { |
| 175 | axisTitle: 'Contributions', |
| 176 | axisClass: 'ct-axis-title', |
| 177 | offset: { |
| 178 | x: 0, |
| 179 | y: 50, |
| 180 | }, |
| 181 | textAnchor: 'middle', |
| 182 | flipTitle: true, |
| 183 | }, |
| 184 | }), |
| 185 | ], |
| 186 | }; |
| 187 | |
| 188 | axios({ |
| 189 | url: `https://github-readme-activity-graph.vercel.app/data?username=${username}`, |
| 190 | method: 'GET', |
| 191 | }) |
| 192 | .then((contributionData) => { |
no test coverage detected