score:21
Accepted answer
Try this fiddle: http://jsfiddle.net/a6zsn/70/
We had a similar issue which we eventually solved by allowing the labels to use HTML. While we didn't go with the exact solution posted below, this should work for you as it uses the jQueryUI tooltip widget to show the full text on hover.
Note how I'm defining the xAxis.labels object.
$(function () {
var chart;
$(document).ready(function() {
chart = new Highcharts.Chart({
chart: {
renderTo: 'container',
type: 'bar',
events: {
load: function (event) {
$('.js-ellipse').tooltip();
}
}
},
title: {
text: 'Historic World Population by Region'
},
subtitle: {
text: 'Source: Wikipedia.org'
},
xAxis: {
categories: ['Africa is the best place to do safari. Label is soooo big that it iss ugly now. =(. -38023-8412-4812-4812-403-8523-52309583409853409530495340985 ', 'America is the best place you can ever live in ', 'Asia is the best food ever ', 'Europe best chicks ever on earth ', 'Oceania i dont know any thing about this place '],
title: {
text: null
},
labels: {
formatter: function () {
var text = this.value,
formatted = text.length > 25 ? text.substring(0, 25) + '...' : text;
return '<div class="js-ellipse" style="width:150px; overflow:hidden" title="' + text + '">' + formatted + '</div>';
},
style: {
width: '150px'
},
useHTML: true
}
},
yAxis: {
min: 0,
title: {
text: 'Population (millions)',
align: 'high'
},
labels: {
overflow: 'justify'
}
},
tooltip: {
formatter: function() {
$("#mytoolTip").html(this.x + 'and the value is ' + this.y) ;
return false ;
}
},
plotOptions: {
bar: {
dataLabels: {
enabled: true
}
}
},
legend: {
layout: 'vertical',
align: 'right',
verticalAlign: 'top',
x: -100,
y: 100,
floating: true,
borderWidth: 1,
backgroundColor: '#FFFFFF',
shadow: true
},
credits: {
enabled: false
},
series: [{
name: 'Year 1800',
data: [107, 31, 635, 203, 2]
}, {
name: 'Year 1900',
data: [133, 156, 947, 408, 6]
}, {
name: 'Year 2008',
data: [973, 914, 4054, 732, 34]
}]
});
});
});
score:4
Trim the labels
xAxis: {
categories: ['Foo afkhbakfbakjfbakfbnbafnbaf', 'Bar', 'Foobar'],
labels: {
formatter: function() {
return this.value.substring(0, 8);
}
}
},
score:6
Source: stackoverflow.com
Related Query
- dealing with highcharts bar chart with really long category names
- Highcharts single horizontal stacked bar chart with data names (labels) and %-ages always shown and data numbers and series name shown on mousehover
- How to render a bar chart with different series with only one entry per category in HighCharts
- creating a bar chart using Highcharts with React - getting an error that rendering div isn't found
- Adding round corners to Highcharts Bar Chart with stacked bars when value is 0
- Highcharts bar chart with fixed bar widths and gaps
- Splitted bar chart for paired data with highcharts
- Highcharts vertical stacked bar chart with negative values, is it possible?
- HighCharts - bar chart with indicator
- Highcharts GANTT chart - need to allow category with no data
- How to change color of bar in column chart with different level of percentage in highcharts
- Highcharts - Dealing with small values in Funnel chart
- Show/Update Separate Bar graphs with Drilldown Pie chart of Highcharts
- (Horizontal) bar and line chart with Highcharts
- How to make split grouped column bar chart in highcharts with percentage?
- highcharts column chart with line, need line start at bar start
- HighCharts line series not displaying properly with stacked bar combo chart
- Highcharts - bar chart columns too thin with too many series
- Custom bar chart text with Highcharts
- HighCharts basic bar chart provide the xAxis categories with Series
- Category names and the chart are not aligned in polar chart, Highcharts
- Highcharts cloud issue with data source when duplicating chart
- Highcharts bar chart with capacity
- correct positioning with Highcharts renderer on a bar chart
- Highcharts complex bar chart design with circular annotation or secondary legend
- How to plot stacked bar chart in highcharts with dynamic data?
- Highcharts Stacked bar chart with db value (Dynamic Data)
- High charts bar chart label overlaps with the graph when labels are long
- Highcharts horizontal bar chart with text inside bars
- Highcharts bar chart with bar colored based on value
More Query from same tag
- Highcharts-How to align shared tooltip on the top of column in multiple series column chart?
- Need assistance for a part with json/php
- Highcharts: Using JS arrays to populate series and x-axis categories
- How to reformat a HighChart series to for CSV export
- Highcharts tooltip format different with series
- Highcharts - Markers in line charts move up when leaving hovering
- Show tooltip in column chart when hovering crosshair line
- Highcharts and JSON problems
- Set ID to div and show the div after clicking a button using jquery
- my highchart is currently is not working with pie spline chart in updating after rendering chart
- Can I load the columns (each series) one by one in a HighChart JS?
- Highcharts xrange chart is not respecting datetime xAxis min and max values - shows space on both sides
- Highcharts synchronized charts to show crosshair when snap is false
- Highstock - custom tickPositioner and tickInterval
- Highchart stockChart Installation in Web Component
- HighCharts Adding a Back Button when data is set through point.events.click
- Highcharts legend position same as tooltip position or make tooltip still visible after hiden series
- How to spread Y Axis values in "area" chart using HighCharts
- Get Tooltip content from a point from a line/scatter plot in highcharts from javascript
- how to remove scroll bar in drill down highchart
- When changing data, why is the data reduced every time the button is pressed?
- How to make a pie chart from highcharts responsive
- HighCharts : Shared Tooltip with shared Data LABELS (in Series)
- Combine two data fields in highcharts
- Changing Highcharts data series type dynamically
- Is there a way to get Highstock Scrollbar to respond to trackpad?
- Highchart: Custom Fixed Placement chart
- highcharts line not showing properly
- rcharts highcharts plotLines
- HighCharts/Highstock: How to programmatically draw the mouse line