Hide total in stack column chart

Answered
TWiRote asked on July 24, 2023

I don't want the total to show as I have highlighted in red, what do I do?

5 answers

Public
Nadia Khodakivska Nadia Khodakivska Flexmonster July 24, 2023

Hello,

Thank you for contacting us.

We recommend using the customizeChartElement API call to edit the tooltip:

function customizeChartElementFunction(element, data) {
  for (let el of element.children) {
    el.innerHTML = removeTotal(el.innerHTML);
  }
}
// the helping function
function removeTotal(inputString) {
  const totalIndex = inputString.indexOf('Total: ');

  if (totalIndex !== -1) {
    return inputString.substring(0, totalIndex);
  }

  return inputString;
}

You are welcome to check the following JSFiddle for reference: https://jsfiddle.net/flexmonster/dc53u4mj/ 

Please let us know if it works for you. Looking forward to hearing from you.

Kind regards,
Nadia

Public
Nadia Khodakivska Nadia Khodakivska Flexmonster August 1, 2023

Hello,

Hope you're doing great. 

We were wondering if you had had the chance to test the recommended approach. Please let us know if it works for you.

Looking forward to hearing your feedback.

Kind regards,
Nadia

Public
Nadia Khodakivska Nadia Khodakivska Flexmonster August 16, 2023

Hello,

Hope you are doing well.

Just checking in to ask if you had a chance to check our example. Let us know if you need any further assistance or have any other questions.

Looking forward to hearing your feedback.

Kind regards,
Nadia

Public
TWiRote August 18, 2023

Hi,
I have tried as you suggested and it works fine.

Public
Nadia Khodakivska Nadia Khodakivska Flexmonster August 18, 2023

Hello,

Thank you for the response.

We are glad to hear that the solution works for you.

As always, don't hesitate to contact us in case any questions arise.

Kind regards,
Nadia

Please login or Register to Submit Answer