signoz/frontend/src/lib/uPlotLib/utils/getRenderer.ts
Rajat Dabade 9964e3425a
Feat: Bar chart (#4562)
* feat: added bar panel and configuration for bar chart
2024-02-28 14:56:50 +05:30

23 lines
483 B
TypeScript

import uPlot from 'uplot';
import { drawStyles, lineInterpolations } from './constants';
const { spline: splinePath, bars: barsPath } = uPlot.paths;
const spline = splinePath && splinePath();
const bars = barsPath && barsPath();
const getRenderer = (style: any, interp: any): any => {
if (style === drawStyles.line && interp === lineInterpolations.spline) {
return spline;
}
if (style === drawStyles.bars) {
return bars;
}
return null;
};
export default getRenderer;