(labels, refreshRate, theme='light')
| 23 | |
| 24 | /* Transform the labels data to suit ChartJS */ |
| 25 | export function transformData(labels, refreshRate, theme='light') { |
| 26 | let datasets = Object.keys(labels).map((label, i)=>{ |
| 27 | return { |
| 28 | label: label, |
| 29 | data: labels[label] || [], |
| 30 | borderColor: getChartColor(i, theme), |
| 31 | pointHitRadius: DATA_POINT_SIZE, |
| 32 | }; |
| 33 | }) || []; |
| 34 | |
| 35 | return { |
| 36 | datasets: datasets, |
| 37 | refreshRate: refreshRate, |
| 38 | }; |
| 39 | } |
| 40 | |
| 41 | /* URL for fetching graphs data */ |
| 42 | export function getStatsUrl(sid=-1, did=-1, chart_names=[]) { |
no test coverage detected