max imax
max imax

Reputation: 2251

highchart Axis values color

I could not find the color value for each Axis in highcharts api documentation. in other words I mean changing color of numbers at left/down side of each axis.

currently the configuration for Axis is like this:

xAxis: {
    lineColor: '#d8efe3',
    labels: {
        formatter: function() {
            return this.value; // clean, unformatted number for year
        }
    }
},
yAxis: {
    lineColor: '#d8efe3',
    gridLineColor: '#d8efe3',
    title: {
        text: null
    },
    labels: {
        formatter: function() {
            return this.value / 1000 +'k';
        }
    }
},

edit: there is nothing special about the chart, anyway assume the chart is as simple as this one: http://jsfiddle.net/highcharts/llexl/

Upvotes: 2

Views: 5394

Answers (2)

Dom
Dom

Reputation: 40463

I believe you are referring to the labels. Just change the style for the yAxis label.

DEMO

xAxis: {
    lineColor: '#d8efe3',
    labels: {
        formatter: function() {
            return this.value; // clean, unformatted number for year
        }
    }
},
yAxis: {
    labels: {
         style: {
             color: 'orange'
         },
         formatter: function() {
            return this.value / 1000 +'k';
         }
    },
    lineColor: '#d8efe3',
    gridLineColor: '#d8efe3',
    title: {
        text: null
    }
},

Hope this helps and let me know if you have any questions!

Upvotes: 6

thtsigma
thtsigma

Reputation: 4938

This should change x and y axis label colors to red. I believe this is what you are looking for.

xAxis: {
  lineColor: '#d8efe3',
    labels: {
      style: {
        color: 'red'
      },
      formatter: function() {
        return this.value; // clean, unformatted number for year
      }
    }
  }
},

yAxis: {
  lineColor: '#d8efe3',
  gridLineColor: '#d8efe3',
  title: {
    text: null
  },
  labels: {
    style: {
      color: 'red'
    },
    formatter: function() {
     return this.value / 1000 +'k';
   }
 }

},

example Docs

Upvotes: 1

Related Questions