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

Title not consistent when xAxis label shortened #7179

zbycz opened this issue Sep 21, 2017 · 4 comments

Title not consistent when xAxis label shortened #7179

zbycz opened this issue Sep 21, 2017 · 4 comments


Copy link

@zbycz 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


Copy link

@sebastianbochan 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, '>');
Copy link

@pawelfus 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 Type: Bug label Sep 22, 2017
Copy link

@zbycz zbycz commented Sep 22, 2017

Thanks for the help.

Copy link

@TorsteinHonsi 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
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants