Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(Highcharts plugin): remove tooltip lines sorting #103

Merged
merged 1 commit into from
Dec 13, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions src/plugins/highcharts/renderer/helpers/tooltip/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable complexity */

import {escape as _escape, orderBy as _orderBy} from 'lodash';
import _escape from 'lodash/escape';
import {i18n} from '../../../../../i18n';
import type {Highcharts} from '../../../types';
import type {TooltipData, TooltipLine, RowRenderingConfig} from './types';
Expand Down Expand Up @@ -214,7 +214,6 @@ export const formatTooltip = (
const selectedLineIndex = data.lines.findIndex(({selectedSeries}) => selectedSeries);
const selectedLine = data.lines[selectedLineIndex];
const lines = data.lines.slice(0, (tooltip.lastVisibleRowIndex || data.lines.length) + 1);
const sortedLines = _orderBy(lines, ['originalValue'], ['desc']);
const withShapes = lines.every((line) => line.seriesShape);
const unsafe = data.unsafe;
const tooltipHeaderRaw = data.tooltipHeader?.trim();
Expand Down Expand Up @@ -326,7 +325,7 @@ export const formatTooltip = (
</thead>`
}
<tbody class="${TOOLTIP_LIST_CLASS_NAME}">
${sortedLines
${lines
.map((line, index) => renderRow(line, getRowRenderConfig(index)))
.join('')}
</tbody>
Expand Down