score:50
Accepted answer
You can call the original formatter from your formatter function:
$(function () {
$('#container').highcharts({
yAxis: {
labels: {
formatter: function () {
return '$' + this.axis.defaultLabelFormatter.call(this);
}
}
},
series: [{
data: [15000, 20000, 30000]
}]
});
});
score:2
I looked in HighCharts source code and found out that if you pass a format
or formatter
it won't add numeric symbol. It is inside else if
statement i.e. formatOption xor numericSymbol. So you need to add a formatter and do the logic yourself.
this is a slightly modified copy-paste of their code:
formatter: function() {
var ret,
numericSymbols = ['k', 'M', 'G', 'T', 'P', 'E'],
i = numericSymbols.length;
if(this.value >=1000) {
while (i-- && ret === undefined) {
multi = Math.pow(1000, i + 1);
if (this.value >= multi && numericSymbols[i] !== null) {
ret = (this.value / multi) + numericSymbols[i];
}
}
}
return '$' + (ret ? ret : this.value);
}
Source: stackoverflow.com
Related Query
- Format Highcharts y-axis labels
- Highcharts - Long multi-line y axis labels causing following label to be removed
- Highcharts - with datetime axis labels overlap
- Highcharts yaxis labels Format
- Highcharts label format with tickPositioner in a datetime x Axis
- Highcharts - Multiple Axis Graph not displaying labels
- Show some specefic number on gauge highcharts axis labels
- Making y axis of highcharts in time format hh:mm
- How to adjust line-height/ellipses in Highcharts axis labels
- Highcharts -- Can't apply style to x axis labels
- Highcharts 12hr time format of x-axis labels
- How to position labels for plotbands on y axis in Highcharts
- Chart's width is impacting to my second x axis labels in Highcharts
- How To Show All Data Labels For Datetime Axis In Highcharts
- Wrong labels on X axis on Highcharts
- Replace axis labels with custom in highcharts r
- How to handle mouse events on axis labels in highcharts
- Fourth y axis does not show labels in Highcharts
- HighCharts Bubble Chart: text for axis interval labels
- Multiple images for Highcharts X Axis Labels
- highcharts axis format decimal point
- Highcharts datetime axis labels according to data point groups
- highcharts missing x axis labels when stacking two charts
- Highcharts format labels on grouped stacked bar diagram with $ k, M for currency and 'hrs' for time
- x Axis Labels are cut off from Highcharts Column Chart
- Highcharts and EXTJS 3: Labels in x axis overlap
- How to add text labels to a numerical x axis in Highcharts
- How to display months in x axis labels in highcharts
- Dynamic Labels for X axis in HighCharts
- Highcharts streamgraph Y Axis Labels
More Query from same tag
- onClick takes two clicks to populate results, HighCharts
- Highcharts : selection
- Heatmap values are lapsing in Highcharts
- Disabling HighCharts labels
- React - Highcharts Full Screen black bar
- Highcharts / Highstock scroll bar and Zoom issue
- Highcharts Detect mouseOver event only in the colored area
- Clickable link in tooltip of Highcharts
- How to plot line chart with series data in highcharts?
- How to save highchart image in to particular location in my local
- Highcharts age stacking
- Highcharts - Include several charts in one container
- Display the value of plotband border in the highcharts
- Highcharts TypeScript Boost module
- Highcharts: wrap column chart month ranges in year
- Styling Highmap Legend
- highcharter - where are the already downloaded maps for hcmap() stored on a (shiny) server?
- Highchart and php
- highcharts zoom series dissapeares
- Show ranges as legend for highcharts angular gauge
- Highcharts Export Server on AWS Lambda
- jsPDF not rendering html element with -v 1.2.61(IE)/ giving 110 error in adobe viewer with -v 1.3.2
- Hiding a highchart series is very slow
- Highcharts slow performance when adding more than 10 series
- I'm getting this error when fly over the chart: TypeError: Cannot read property 'lineWidth' of undefined
- Using HighCharts with Lambda Expression
- Pass array from js for loop to highcharts series data
- Highcharts no drilldown on bar / column click
- DotNet HighCharts Exporting in Web Forms Asp.net
- Can I add custom data for highcharts RSI indicator?