score:9
Accepted answer
you can use axis.labels.formatter and return your label in html tag with style attribute, which can define your color.
const color = {
jan: 'red',
feb: 'green',
mar: 'blue'
}
const chart = highcharts.chart('container', {
chart: {
marginbottom: 80
},
xaxis: {
categories: ['jan', 'feb', 'mar'],
labels: {
formatter () {
return `<span style="color: ${color[this.value]}">${this.value}</span>`
}
}
},
series: [{
data: [29.9, 71.5, 106.4]
}]
})
console.log(chart.series[0].data)
live example: http://jsfiddle.net/508jej83/
score:0
i hope for you!!!
xaxis : {
categories : _category,
labels : {
formatter : function() {
if (_category != null && _category.length > 0) {
var currentcolumn = -1;
for (var i = 0; i < _category.length; i++) {
if (_category[i] == this.value) {
currentcolumn = i;
break;
}
}
if (isnumbereven(currentcolumn)) {
return '<span style="fill: blue;">' + this.value + '</span>';
} else {
return this.value;
}
}
}
}
}
Source: stackoverflow.com
Related Query
- How to change Highcharts xAxis label color individually?
- How to change the text color in Highcharts
- Highcharts - how to disable color change on mouseover/hover
- How to change axis label size when exporting in Highcharts / Highstock
- How to change area graph color above certain value in Highcharts
- How to set series-label to false by default and change the color of series label text in highchart
- In highcharts how do I change the color of the line above the categories?
- How do I change a specific bar color in Highcharts Bar Chart?
- Update color of plotline label on change highcharts
- How to change one point color on click in Highcharts
- How to change the color of highcharts series graph to black & white during downloading it as an image?
- How to change the bar color in Highcharts
- How to change color of bar in column chart with different level of percentage in highcharts
- How to change Highcharts xAxis formatting from yearly to monthly?
- How to show xAxis label in tooltip in a Highcharts area chart?
- How to change the line color of a bubble in highcharts dynamically
- Highcharts - XAxis Label with LineFeed - how to make smaller gap?
- How to change color of lable (name) in a highcharts series?
- How to change highcharts bars width individually
- How to change line color when loading static csv data into Highcharts Highstock graph?
- How to change gauge meter color based on value in highcharts
- how to get dynamic color change based on values in highcharts
- Highcharts - Column Chart Drilldown, how to change the drilldown bar color based on some value
- how to change grid alternate color in highcharts
- how do you change the color of cells in highcharts heatmap?
- Highcharts Highstock How do I change the label on top of tooltip for OHLC series data?
- How to change the color of a custom renderer text to the title color in Highcharts
- Highcharts Highmaps How to change value for color axis in map bubble
- How to change tick and minorTick color in different interval in highcharts gauge charts
- How can I focus or change label color on mouse-hover in Timeline Highchart?
More Query from same tag
- React highcharts unable to call function from data label onclick
- HighCharts getting data from database to outside js file
- live chart for heartbeats
- timeline yAxis format with minutes:seconds only
- Highcharts Highstock How do I change the label on top of tooltip for OHLC series data?
- Highcharts (grouped_category styling) and tooltip formatter not working
- Highchart Axis Update/ chart redraw
- Highcharts and jQuery animate: Snaps back to original size; only works when window is resized
- How to Change marker symbol and dataLabel with custom style in Highcharts
- MYSQL query for concatenating values (highcharts series data)
- highcharts JSON google earth
- How to add mean in a boxplot made with highcharter?
- How to display a Bar Chart in DataTable
- Highcharts - how can I change font size?
- how to add color inside a 3d chart in highchart js
- In Highcharts, how to set width of plot bands on y-axis in column chart?
- GWT - Adding a button to HighCharts
- Event ExportData in Highcharts
- PIE CHART - Data Visualization With DataTables and Highcharts
- How to make responsive highchart?
- R-highcharter combine tooltips
- Passivate Highcharts Export Phantom JS Web Server?
- Highcharts not referenced error when using setOptions
- Highcharts Line Chart Drill down into multiple series
- JSON to javascript Date.UTC
- highcharts can't render
- HighCharts - show xaxis titles
- PIE Chart is not working in IE 8 with HighCharts
- HighStock if time inertval missing shows red line or blank space?
- How to add custom icons as markers in Highcharts