score:5
Accepted answer
you can change highcharts.series.prototype.drawdatalabels
, the function to draw the datalabels
:
highcharts.series.prototype.drawdatalabels = (function (func) {
return function () {
func.apply(this, arguments);
if (this.options.datalabels.enabled || this._haspointlabels) realignlabels(this);
};
}(highcharts.series.prototype.drawdatalabels));
realignlabels
would be the function to check for the shorter columns, and in it change the rotation
, x
and y
of that specific datalabel
:
function realignlabels(serie) {
$.each(serie.points, function (j, point) {
if (!point.datalabel) return true;
var max = serie.yaxis.max,
labely = point.datalabel.attr('y'),
labelx = point.datalabel.attr('x');
if (point.y / max < 0.05) {
point.datalabel.attr({
y: labely - 20,
x: labelx + 5,
rotation: 0
});
}
});
};
Source: stackoverflow.com
Related Query
- Change Datalabel Color, Rotation and Align values based on Column value in highcharts
- highcharts: column chart color change based on value
- Highcharts - Column Chart Drilldown, how to change the drilldown bar color based on some value
- Highcharts Change Bar Color Based on Value
- Highcharts dynamically change bar color based on value
- Highcharts Change Bar Background Color Based on categories value
- how to change color of line chart in highchart based on a categorical column in r?
- Change color code on colum, depending on data value (highchartJS)
- How to change gauge meter color based on value in highcharts
- how to get dynamic color change based on values in highcharts
- Column based Highchart drilldown series assign color code to each column
- rCharts : Highcharts column with color based on value
- Highcharts How to change align of data labels based on value
- How to dynamically change line color based on value being lower than previous in highcharts
- Highcharts - Column Chart: Compare corresponding values to change color
- Fill color for each area based on x and y start, end values
- Change the color of the bar chart based on the value
- Change Color of Highmap Areas based on database values
- Change Candle color based on Stochastic values
- Color columns based on x axis and not on values (y axis) in highcharts
- Change graph color above and below plot-line in Column chart in Highcharts
- Yii Highchart extension - Change color based on value
- Highcharts - Stacked Bar Column - Total Value of Stacked Bar not Correct with Negative and Positive Values
- Change color of bars depending on value in Highchart bar-chart with MVC3
- Highcharts column range change color for negative numbers
- Highcharts Change column color on hover
- Highcharts - Column With Negative Values - Column Color
- change legend color high charts based on data
- Changing color of spline lines based on values in HighCharts
- Highcharts, How can I change the datalable distance in a pie chart based on the value
More Query from same tag
- Don`t work animation on highcharts basic line
- Highcharts and EXTJS 3: Labels in x axis overlap
- Highcharts: Remove padding around column chart
- Highchart doesn't display in IE7/8
- Highmaps: Wrap fillSetter for colorAxis
- Highcharts show max., min., and average for each serie in legend
- Highcharts steps to setup own server for download
- HighCharts pointPlacement option not working in a single column chart
- Problem with multiple labels in Highchart
- Transform an object array to an array
- Highcharts spiderweb with columns without rounded edge
- Use variable radius from HighCharts
- highchart/highstock navigator doesn't work with keyboard
- Highcharts cloud Scatter plot with data array
- In highcharts,series without dynamic data does not shift
- Display legend items in two columns highcharts
- Highcharts - Trying to get a dyamic spline to update from left to right
- Highcharts: How to change colors of all areas except hovered one on MouseOver event in area plot
- How to hide the Axis line in stack bar chart high chart
- Pass string variable to data Highchart
- How to disable the animation of the datalabels on a pie chart with HIghcharts?
- How to make Highchart 2 or more inner Pie but only 1 outer pie with donut type?
- highcharts doesn't read data, works with fake data
- How to bind to Highcharts constructor/listen to CustomEvents from Vue component
- Receiving incorrect datetimes when using milliseconds for x-axis?
- SignalR update breaks layout and scripts on page
- Searching for JS based (Highcharts, AnyChart, etc) thermometer or vertical linear gauge with multiple pointers
- Highcharts color issue when using Boost module
- HighCharts-XRange Series: how to restrict data labels width to stay within corresponding data point width
- Export Server not configured for Highcharts-export-server