score:3
Accepted answer
You need to set useHTML true in formatter function of yAxis label.See the code below and working fiddle here
for dynamic image, you can put image path as variable. If you don't want to show axis value remove "this.value" from formatter function
yAxis: { labels: {
formatter: function() {
return '<img src="http://highcharts.com/demo/gfx/sun.png" alt="" style="vertical-align: middle; width: 32px; height: 32px"/>'+ this.value;
},
useHTML: true
}
}
score:1
Just in case anyone else is looking for making a chart with y axis having multiple images, here's how I did it:
var chartScales = scales.map(function(x){ return { value:x.Text, key:++imageIndex, image:x.DefaultImage }; });
var chart = $("#chartContainer").highcharts({
chart: {
type: 'spline'
},
yAxis:{
categories: chartScales,
labels: {
formatter : function()
{
// if there's an image use it, otherwise use the text, or key value
if(this.value.image != null)
return "<img src='"+ this.value.image +"' style='vertical-align: middle; width: 32px; height: 32px'/>"+(this.value.value != null ? this.value.value : this.value.key);
return this.value.value != null ? this.value.value : this.value.key;
},
useHTML: true
}
},
series: [{
data: []
}]
});
Source: stackoverflow.com
Related Query
- How do I put Icons in the y Axis for a Dynamic Highcharts chart?
- How can I update the data in highcharts for both x axis & y axis?
- How to plot the X axis data point for uneven tick interval at in Highcharts
- How do I hide the code for the chart data in highcharts?
- How to display the value instead of percentage in a pie chart using jquery Highcharts
- Highcharts - how to have a chart with dynamic height?
- how to set the interval of points on Y - Axis highcharts
- How replicate the value of Y Axis on both sides of the axis in Highcharts
- How do you increase the performance of highcharts chart creation and rendering
- HighCharts - How to create dynamic chart that exports EVERYTHING
- Highcharts - How to set custom colors for the series
- Highcharts - set maximum range for yAxis but keep axis dynamic within that range
- How to add space between chart and axis in highcharts
- Highcharts Bar Chart - How to set the minimum bar width/length
- Highcharts - Bar - Setting the X axis width and the chart area width to be constant
- How to completely disable the mouse/finger interaction for highcharts
- How to use add series and update methods in the high chart wrapper for angular?
- How to customize the crosshair Line for Highcharts
- Highcharts Bubble Chart - How to move an individual point's data label (dataLabel) to the front/top
- How to position labels for plotbands on y axis in Highcharts
- How to format my json data for stack column chart in HighCharts
- HighCharts - Show categories in x axis intead of the value of x in Bubble Chart
- How To Dynamically Truncate The Y-Axis Title On Chart Resize/Reflow In Highcharts
- How To Show All Data Labels For Datetime Axis In Highcharts
- Highcharts context menu button appearing thrice for the same chart
- How to show Legends for all the series data in stacked column chart Highcharts?
- Highcharts - how to create multiple y axis and group the data series
- how to display 2 same highcharts without duplicate the code
- Highcharts - In area chart how to use gradient color for multiple series?
- How can I set the alignment for individual axis labels in highcharts?
More Query from same tag
- HIghcharts Heatmap Overload with Too Much Data?
- Passing data from JSP to jQuery and plotting in Highcharts
- is it possible to add a legend for bubble size in high charts?
- Highcharts Navigator shows datetime in milliseconds
- Highcharts add legend on export
- How to update drilldown data in highchart without redraw the chart?
- Highcharts Polar Plot area scaling issues
- Adding regression to multiple series imported from CSV
- highcharts.js add mouseOver function or hover states (implement breaks chart?)
- xAxis values groups as slices + labels in Highcharts
- Can we have 2 Y-axis for StockCharts in HighCart.js?
- HIghchart Area Chart display NULL value in a wrong way
- Move series legends below x-axis in highcharts
- Highcharts with datatable
- Force Highcharts to use my min and max
- printing pie's dataLabels numbers with commas
- HighChart Line Graph value from database
- React Highchart: Synchronized chart and tooltip is not highlighting the points
- Remove spaces between axes and columns in Highcharts with only one category
- Highcharts - how to remove "Open in Highcharts Cloud" from the export menu
- How to set min start date for Highcharts plot?
- Find special chart on highcharts
- Highcharts - Updating a chart's option after initial render
- Highchart area range on a plot column
- HighCharts - Permanent tooltip on solid gauge
- Set a minimal default range for a column chart in Highcharts
- Highcharts dynamic data from an Api
- The graph is not equal on the basis of the addition code in Highcharts
- Highcharts y axis thousands separator
- Highcharts - Pie Chart change slice colors dynamically