mirror of
https://github.com/openobserve/openobserve.git
synced 2026-11-04 16:09:05 +00:00
fix: Bar Chart not rendering as expected when breakdown is present (#5624)
#5597 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Bug Fixes** - Improved label retrieval process to handle cases with undefined axis keys. - Enhanced series generation logic for bar and horizontal bar charts. These updates ensure a more reliable experience when processing chart configurations in the dashboard. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -1190,7 +1190,11 @@ export const convertSQLData = async (
|
||||
panelSchema.type == "h-stacked") &&
|
||||
panelSchema.queries[0].fields.breakdown?.length)
|
||||
) {
|
||||
return yAxisKeys.length === 1 ? xAXisKey : `${xAXisKey} (${label})`;
|
||||
return yAxisKeys.length === 1
|
||||
? xAXisKey
|
||||
? xAXisKey
|
||||
: label
|
||||
: `${xAXisKey} (${label})`;
|
||||
}
|
||||
|
||||
return label;
|
||||
@@ -1214,7 +1218,8 @@ export const convertSQLData = async (
|
||||
|
||||
if (
|
||||
breakDownKeys.length &&
|
||||
(panelSchema.type === "bar" || panelSchema.type === "h-bar")
|
||||
(panelSchema.type === "bar" || panelSchema.type === "h-bar") &&
|
||||
!panelSchema.config.trellis?.layout
|
||||
) {
|
||||
const seriesData = getAxisDataFromKey(yAxis);
|
||||
return getSeriesObj(yAxisName, seriesData, seriesConfig);
|
||||
@@ -2097,9 +2102,7 @@ export const convertSQLData = async (
|
||||
}
|
||||
});
|
||||
|
||||
options.xAxis.forEach((it: any) => {
|
||||
it.type = "time";
|
||||
});
|
||||
options.xAxis[0].type = "time";
|
||||
|
||||
options.xAxis[0].data = [];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user