Skip to content

Commit

Permalink
Fix legend visibility for legacy monitoring charts (#178)
Browse files Browse the repository at this point in the history
* Fix legend visibility for legacy monitoring charts

* Correct fix
  • Loading branch information
artemipanchuk authored Nov 8, 2023
1 parent 6a0b27e commit f7b5bdb
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/server/modes/charts/plugins/ql/preparers/line-time.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {DATALENS_QL_TYPES, QlConfigPreviewTableData} from '../../../../../../shared';
import {DATALENS_QL_TYPES, IChartEditor, QlConfigPreviewTableData} from '../../../../../../shared';
import type {
QlConfig,
QlConfigResultEntryMetadataDataColumn,
Expand All @@ -25,11 +25,13 @@ export default ({
columns,
rows,
tablePreviewData,
ChartEditor,
}: {
shared: QlConfig;
columns: QlConfigResultEntryMetadataDataColumn[];
rows: string[][];
tablePreviewData?: QlConfigPreviewTableData;
ChartEditor: IChartEditor;
}) => {
if (columns === null) {
return {};
Expand Down Expand Up @@ -255,6 +257,14 @@ export default ({
++inserted;
++colorGroup.size;
});

if (shared.extraSettings.legendMode !== 'hide') {
ChartEditor.updateLibraryConfig({
legend: {
show: true,
},
});
}
}

columns.forEach((column, index) => {
Expand Down

0 comments on commit f7b5bdb

Please sign in to comment.