score:10
Accepted answer
This case you can get the max
by the following line:
this.axis.max;
So your function should be:
formatter: function() {
var maxElement = this.axis.max;
if (maxElement > gb) {
return (this.value / gb).toFixed(1) + " GB";
} else if (maxElement > mb) {
return (this.value / mb).toFixed(1) + " MB";
} else if (maxElement > kb) {
return (this.value / kb).toFixed(1) + " KB";
} else {
return (this.value) + " B";
}
}
You can see it working here.
Source: stackoverflow.com
Related Query
- How can I change the unit at y axis dynamically at Highcharts?
- How can I change the colors of my highcharts piechart?
- How do I dynamically change the yAxis min, max and tickInterval in HighCharts
- Highcharts large treemap how can I dynamically change allowDrillToNode flag?
- How to change the line color of a bubble in highcharts dynamically
- How can you change the "label" (valueSuffix) on a highcharts gauge after the gauge has been created?
- How can I change data series dynamically in HighCharts without overwriting initial series?
- How I can change the axis both side in y axis?
- How can I update the data in highcharts for both x axis & y axis?
- How can I change highcharts events after the chart has been initialized
- How can I set the units on multiple axis on Highcharts
- How can I align the scale on my HighCharts graph with the axis rather than the margins?
- How can i change the color of a tile which was clicked of a treemap in highcharts using react
- how can I use rangeselector and navigation in highcharts in the given code
- HighCharts - How can I turn off the points?
- How do you change the colour of each category within a highcharts column chart?
- 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 can I get the max value of a y axis at highcharts?
- How to change the text color in Highcharts
- How do I dynamically change a data point in Highcharts using JavaScript
- How can i hide all the Series in highcharts at a time
- How can I remove the white border from HighCharts pie chart?
- Highcharts how to change x axis options
- How can I change the width of the bars in a highchart?
- How to dynamically change axis from linear to logarithmic in HighChart
- How to change axis label size when exporting in Highcharts / Highstock
- How can I delete all of the points from a highcharts series
- Highcharts, How can I change the datalable distance in a pie chart based on the value
- How can i change highcharts data values by selecting from a dropdown list
More Query from same tag
- Range selector input fields can't edit after hide() show()
- highcharts: use JSON in drilldown
- how to disable or override the fonts inherited from svg in the web pages by default
- Highcharts Maps - Rounded zoom buttons
- Can hidden values be passed between a highcharts drilldown?
- Show only three levels of highchart Sunburst always on each click in Angular8
- Highchart customized x axis values with Group By Year
- How to aligment nodes with highcharts
- Highchart Category Label not showing in angular 7
- HighCharts rest zoom fails on xy
- Highcharts tooltip displayed over div
- Activity gauge High Chart with Gradient
- Using a highstock chart with stacked series
- How to reverse a bar chart in highcharts?
- HIghcharts.js add catgories with addseries on column chart
- Highcharts Column Group Highlight Dynamically
- Highchart show/hide y axis with multiple associated series
- Correct format of using csv data to plot highchart
- multiple Y axis - margin
- Why does highchart not recognize my dates?
- highcharts change exporting option dynamically
- How to cut off the line in highcharts between two pointI
- Spring MVC: How to display Hashmap keys and values in highcharts
- PHP and highcharts: add mysql results as new column in CSV file
- How can I move columns to the right in a Highcharts chart?
- Highstock: label the y-axis Maximum
- Highcharts annotations not rendering
- Highcharts: Tooltip on a single series only
- how to add percentage sign along with int value in graph in java script
- color in legend with range highcharts