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

Title not consistent when xAxis label shortened #7179

zbycz opened this Issue Sep 21, 2017 · 4 comments


None yet
4 participants

zbycz commented Sep 21, 2017

Expected behaviour

Shortened xAxis label displays the same text in label and its title including html entities.

Actual behaviour

Html entities for title are not processed.

Note, they are processed for the label by this method:

unescapeEntities = function (inputStr) {
objectEach(renderer.escapes, function (value, key) {

You should probably extend this section of titleSetter() method:

// #3276, #3895
(String(pick(value), '')).replace(/<[^>]*>/g, '')

Live demo with steps to reproduce

Hover over the first label on xAxis

Affected browser(s)

Chrome 61 on macos

Related issue



This comment has been minimized.


sebastianbochan commented Sep 22, 2017

Hi @zbycz
Thank you for the reporting.



Based on solution from buildText method:

unescapeAngleBrackets = function(inputStr) {
     return inputStr.replace(/&lt;/g, '<').replace(/&gt;/g, '>');

This comment has been minimized.


pawelfus commented Sep 22, 2017

Hi @zbycz

You are right, it should be consistent.

Unescape entities:

(function(H) {
  H.wrap(H.SVGElement.prototype, 'titleSetter', function(p, value) {
    var renderer = this.renderer;

    unescapeEntities = function(inputStr) {
        '&': '&amp;',
        '<': '&lt;',
        '>': '&gt;',
        "'": '&#39;',
        '"': '&quot'
      }, function(value, key) {
        inputStr = inputStr.replace(
          new RegExp(value, 'g'),
      return inputStr;

    return, unescapeEntities(value));


@pawelfus pawelfus added the Bug label Sep 22, 2017


This comment has been minimized.

zbycz commented Sep 22, 2017

Thanks for the help.


This comment has been minimized.


TorsteinHonsi commented Dec 21, 2017

Demo with the fix applied:

TorsteinHonsi added a commit that referenced this issue Jan 2, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment