Reputation: 2924
I have a simple line graph created by highcharts.js. I have a lot of tick marks in the x-axis (30), so I set stagger to 2 deal with the marks overlapping each other horizontally. However, the lower row of x-axis tick labels is being cut off by the end of the chart.
No matter how tall I make the chart the lower row of x-axis tick mark labels is cut off. How can I increase the height of this area to fix this? Or is there some other method?
month_chart = new Highcharts.Chart({
chart: {
borderRadius: 0,
height: chart_height,
marginRight: 30,
marginBottom: 25,
renderTo: 'leads-by-month',
type: 'line',
},
title: {
text: 'Past 30 Days',
},
xAxis: {
categories: [<?php print $bymonth_categories; ?>],
labels: {
staggerLines: 2,
},
},
yAxis: {
title: {
text: 'Leads',
style: {color: '#3d3e41', }
},
plotLines: [{
value: 0,
width: 1,
color: '#808080'
}],
min: 0,
},
plotOptions: {
line: {
color: '#578df1',
dataLabels: {
enabled: true,
color: '#3d3e41',
},
enableMouseTracking: false
}
},
legend: {
layout: 'vertical',
align: 'right',
verticalAlign: 'top',
x: -100,
y: 74,
floating: true,
borderWidth: 1,
backgroundColor: '#FFFFFF',
shadow: true
},
series: [{
name: '<?php print $organization['name']; ?>',
data: [<?php print $bymonth_data; ?>]
}]
});
Upvotes: 6
Views: 16141
Reputation: 108512
Just bump up the marginBottom option. The default is 70 which should be plenty for 2 rows of tick labels, you've set it to 25 which is not.
Upvotes: 12