Skip to main content

Function: useChartData()

useChartData(monitor: Monitor, theme: Theme): ChartData

Defined in: src/hooks/site/useSiteAnalytics.ts:272

Generates chart-ready datasets for a site's monitor history.

Parametersโ€‹

monitorโ€‹

Monitor

Monitor whose history should populate the chart.

themeโ€‹

Theme

Theme palette used to style the datasets.

Returnsโ€‹

ChartData

ChartData Suitable for Chart.js line charts.

Remarksโ€‹

Separates data preparation from component logic and applies theme-aware styling to the resulting Chart.js configuration.