Lead volume widget
ui/src/components/adminDashboard/widgets/LeadVolumeWidget
const createGradient = (ctx, index) => {
const gradient = ctx.createLinearGradient(0, 0, 0, 500);
gradient.addColorStop(0.03, lineChartGradients[index].startColor); // start of the gradient
gradient.addColorStop(0.4, lineChartGradients[index].stopColor); // end of the gradient
return gradient;
}; datasets.push(
...Object.keys(firstDatasetData).map((key, index) => ({
label: key,
data: firstDatasetData[key],
borderColor: chartColors[index],
borderWidth: 2,
fill: 'start',
backgroundColor: context => {
const ctx = context.chart.ctx;
return createGradient(ctx, index);
},
cubicInterpolationMode: 'monotone',
tension: 0.3,
pointBackgroundColor: primitiveColors.gray0,
}))
);
datasets.push(
...Object.keys(secondDatasetData).map((key, index) => ({
label: key,
data: secondDatasetData[key],
borderColor: chartColors[index],
borderWidth: 2,
borderDash: [5, 3],
fill: false,
cubicInterpolationMode: 'monotone',
tension: 0.3,
pointBackgroundColor: primitiveColors.gray0,
}))
);externalTooltipHandlerComparison
externalTooltipHandlerComparisonformatDateToNumber
formatDateToNumberPlugin for drawing vertical line on mouse enter to any point
Backend
Last updated