mirror of
https://github.com/SigNoz/signoz.git
synced 2025-12-29 16:14:42 +00:00
18 lines
444 B
TypeScript
18 lines
444 B
TypeScript
|
|
import { grey } from '@ant-design/colors';
|
||
|
|
import { Chart } from 'chart.js';
|
||
|
|
|
||
|
|
export const emptyGraph = {
|
||
|
|
id: 'emptyChart',
|
||
|
|
afterDraw(chart: Chart): void {
|
||
|
|
const { height, width, ctx } = chart;
|
||
|
|
chart.clear();
|
||
|
|
ctx.save();
|
||
|
|
ctx.textAlign = 'center';
|
||
|
|
ctx.textBaseline = 'middle';
|
||
|
|
ctx.font = '1.5rem sans-serif';
|
||
|
|
ctx.fillStyle = `${grey.primary}`;
|
||
|
|
ctx.fillText('No data to display', width / 2, height / 2);
|
||
|
|
ctx.restore();
|
||
|
|
},
|
||
|
|
};
|