mirror of
https://github.com/SigNoz/signoz.git
synced 2025-12-29 08:04:10 +00:00
* style: use 'No Data' for empty graphs * style: use 'No data' for empty graphs Signed-off-by: Marius Kimmina <mar.kimmina@gmail.com> Signed-off-by: Marius Kimmina <mar.kimmina@gmail.com> Co-authored-by: Vishal Sharma <makeavish786@gmail.com>
18 lines
433 B
TypeScript
18 lines
433 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', width / 2, height / 2);
|
|
ctx.restore();
|
|
},
|
|
};
|