fix: pick backend_parameter, env, backend_version from spec in catalog
This commit is contained in:
@@ -28,6 +28,16 @@ const LineChart: React.FC<ChartProps> = (props) => {
|
||||
yAxis
|
||||
} = useChartConfig();
|
||||
|
||||
const axisLabelFormatter = (value: string, index: number) => {
|
||||
if (labelFormatter) {
|
||||
return labelFormatter(value, index);
|
||||
}
|
||||
if (index === xAxisData.length - 1) {
|
||||
return '';
|
||||
}
|
||||
return value;
|
||||
};
|
||||
|
||||
const options = {
|
||||
title: {
|
||||
text: ''
|
||||
@@ -45,7 +55,7 @@ const LineChart: React.FC<ChartProps> = (props) => {
|
||||
...xAxis,
|
||||
axisLabel: {
|
||||
...xAxis.axisLabel,
|
||||
formatter: labelFormatter
|
||||
formatter: axisLabelFormatter
|
||||
}
|
||||
},
|
||||
yAxis,
|
||||
|
||||
@@ -45,6 +45,7 @@ const MixLineBarChart: React.FC<
|
||||
},
|
||||
grid: {
|
||||
...grid,
|
||||
right: 0,
|
||||
top: 20,
|
||||
bottom: 10
|
||||
},
|
||||
|
||||
@@ -4,7 +4,7 @@ export interface ChartProps {
|
||||
showEmpty?: boolean;
|
||||
xAxisData: string[];
|
||||
legendData?: LegendComponentOption['data'];
|
||||
labelFormatter?: (val?: any) => string;
|
||||
labelFormatter?: (val?: any, index?: number) => string;
|
||||
tooltipValueFormatter?: (val: any) => string;
|
||||
height: string | number;
|
||||
width?: string | number;
|
||||
|
||||
Reference in New Issue
Block a user