Skip to content

Commit

Permalink
fix(Highcharts plugin): fix callManageTooltipConfig invocation (#504)
Browse files Browse the repository at this point in the history
  • Loading branch information
korvin89 authored Jul 26, 2024
1 parent 7a8b4e4 commit 552156f
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/plugins/highcharts/renderer/helpers/config/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,10 @@ function getTooltip(tooltip, options, comments, holidays) {
};

if (typeof options.manageTooltipConfig === 'function') {
json = callManageTooltipConfig(options, json, chart);
// manageTooltipConfig could accidently break json variable
// and because of it we create new object as an argument
const updatedJSON = callManageTooltipConfig(options, {...json}, chart);
merge(json, updatedJSON);
}

const usersPointFormat = get(options.highcharts, 'tooltip.pointFormat');
Expand Down Expand Up @@ -855,7 +858,10 @@ function getTooltip(tooltip, options, comments, holidays) {

if (json.lines && json.lines.length > 0) {
if (typeof options.manageTooltipConfig === 'function') {
json = callManageTooltipConfig(options, json, chart);
// manageTooltipConfig could accidently break json variable
// and because of it we create new object as an argument
const updatedJSON = callManageTooltipConfig(options, {...json}, chart);
merge(json, updatedJSON);
}

let hiddenRowsSum = 0;
Expand Down

0 comments on commit 552156f

Please sign in to comment.