Hendrik Kleine
Hendrik Kleine

Reputation: 105

HighCharts Heatmap yAxis title

When I create a Heatmap chart in HighCharts, I cannot seem to add a vertical, yAxis label.

For example, for xAxis I have:

title: {
enabled: true,
text: 'my axis'}

But the same approach does not work for y. I've demonstrated this here:

http://jsfiddle.net/hendrkle/zgjevotx/

For example, it could say "day of week" on the vertical axis.

Thanks!

Upvotes: 0

Views: 1885

Answers (2)

Alexander King
Alexander King

Reputation: 33

  1. As mentioned above, you are setting title:null after declaring it above. Remove that second declaration.
  2. Additionally, your marginBottom:40 is hiding the label in the svg. Remove that declaration.

You can see the fix here: http://jsfiddle.net/85nmcfx0/ .

Upvotes: 1

Halvor Holsten Strand
Halvor Holsten Strand

Reputation: 20536

Your y-axis code, made more readable, is:

yAxis: {
    title: {
        enabled: true,
        text: 'my axis'
    },
    categories: ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday'],
    title: null
}

Note how you are setting title, then setting it to null afterwards.

Remove title: null and it should work perfectly.

Upvotes: 2

Related Questions