Ams
Ams

Reputation: 43

Highcharts : Wordcloud doesnt show words with less weight

Highcharts wordcloud doesnt show words having less weight. Example: https://jsfiddle.net/amrutaJgtp/7evd8tgo/

{
    "name": "UNKNOWN",
    "weight": 584
}, {
    "name": "OTHER",
    "weight": 138
}

Here the words "UNKNOWN" and "OTHER" are not seen.

On the same data, Wordcloud using the library Zing chart, shows all the words well aligned. Example: https://jsfiddle.net/amrutaJgtp/7evd8tgo/3/

    {
      "text": "UNKNOWN",
      "count": 584,
      "color": '#BDD9F2'
    }, {
      "text": "OTHER",
      "count": 138,
      "color": '#D0E9F2'
    }

All the words are properly readable.

Is there any way to achieve this in Highcharts?

Upvotes: 0

Views: 1070

Answers (1)

Paweł Fus
Paweł Fus

Reputation: 45079

Simply labels have font size < 1px and label is not visible, reported on Highcharts github#8065.

Solution: Apply min 1px font-size: https://jsfiddle.net/BlackLabel/7evd8tgo/31/

(function(H) {
  H.wrap(H.seriesTypes.wordcloud.prototype, 'deriveFontSize', function (p) {
    var ret = p.apply(this, Array.prototype.slice.call(arguments, 1));
      return Math.max(ret, 1);
  });
})(Highcharts);

EDIT: This feature is supported since v6.1.0 by minFontSize and maxFontSize options.

Upvotes: 0

Related Questions