score:4
The right way to do it is set the offset
to -15
.
yAxis: {
offset: -15
}
offset:
The distance in pixels from the plot area to the axis line. A positive offset moves the axis with it's line, labels and ticks away from the plot area. This is typically used when two or more axes are displayed on the same side of the plot. Defaults to 0.
score:1
Fixed : http://jsfiddle.net/basarat/pfkbX/1/
Basically need to add yAxis.align = 'left'. Also move the labels up a bit (so they are on the line instead of under the line by setting the y=2 property) and also bring them into focus with x=0 property:
$(function () {
var chart;
$(document).ready(function () {
chart = new Highcharts.Chart({
chart: {
renderTo: 'container',
spacingLeft: 2,
spacingRight: 2
},
credits: { enabled: false },
title: { text: '' },
yAxis: {
title: '',
labels: {
style: {
fontSize:'9px'
},
y:-2,
x:0,
align:'left'
}
},
xAxis: { labels: { enabled: false } }, //hide the x axis labels
series: [{
type: 'area',
name: 'speed',
showInLegend: false,
data: [
71.5, 106.4, 129.2, 144, 176, 135.6, 148.5, 216.4, 194.1, 129.2, 144, 176, 135.6, 148.5, 216.4, 194.1, 129.2, 144, 176, 135.6, 148.5, 216.4, 194.1, 129.2, 144, 176, 135.6, 148.5, 216.4, 194.1, 129.2, 144, 176, 135.6, 148.5, 216.4, 194.1, 129.2, 144, 176, 135.6, 148.5, 216.4, 194.1, 95.6,
71.5, 106.4, 129.2, 144, 176, 135.6, 148.5, 216.4, 194.1, 129.2, 144, 176, 135.6, 148.5, 216.4, 194.1, 129.2, 144, 176, 135.6, 148.5, 216.4, 194.1, 129.2, 144, 176, 135.6, 148.5, 216.4, 194.1, 129.2, 144, 176, 135.6, 148.5, 216.4, 194.1, 129.2, 144, 176, 135.6, 148.5, 216.4, 194.1, 95.6,
54.4]
}],
/* To make it pretty */
plotOptions: {
area: {
animation: false,
lineWidth: 1,
marker: {
enabled: false,
states: {
hover: {
enabled: true,
radius: 5
}
}
},
shadow: false,
states: {
hover: {
lineWidth: 1
}
},
threshold: null
}
}
});
});
});
score:2
Consider using the following using your xAxis object:
maxPadding:0,
minPadding:0
Also make sure your labels closure doesn't include a 'step'
min and max are also a handy way to bind
Source: stackoverflow.com
Related Query
- Remove space between yAxis and data in highcharts
- remove tooltip space between border and content highcharts
- Highcharts semi-pie - remove space between pie and legend
- Highcharts - reduce the space between zero data line and x-axis
- How to change space value between grid and yAxis in Highcharts line chart
- Highcharts: Remove space between plot border and actual chart
- Highcharts - How to remove connecting line between fixed tooltip and point
- How to add space between chart and axis in highcharts
- Highcharts remove gap between start of xAxis and first value
- Highcharts - Global configuration with common code and unique data & Headings
- How to remove space in between bars in HighCharts bar chart?
- How to remove empty space between bars in Highcharts polar chart?
- HighCharts - Need more space between bottom of chart and Xaxis labels
- Animation behave differently between initial load and dynamic data series replacement in Highcharts
- Highcharts show the same yAxis start and end value with multiple data series
- HighCharts - Remove space between series on stacked bar
- Highcharts : How to remove the gap between series and vertical axis?
- Highcharts - column chart has space between bar and xAxis
- How to remove fine white line between halo and Highcharts pie chart
- How do I create data binding between highcharts and Polymer 1.0
- How to remove the gap between yAxis and data?
- Adding space between the line and the fill in a Highcharts area chart
- Highcharts - Remove gap between tooltip border and content
- Highcharts Pie chart how to reduce space between chart and legend caused by plot width
- Highcharts remove space before first bar and after last
- Highcharts - How to change display data and remove mouseover?
- Highcharts data labels not showing on multiple xAxis and yAxis
- Spacing between plot border and start of data plotting in highcharts
- Switch between the view data table and the highcharts graph
- Highcharts Xaxis remove old data and shift left
More Query from same tag
- How to build chart in highchart.js where xAxis(miliseconds) and yAxis(days)?
- Dynamic data binding to Highchart
- Displaying X-Axis as DD/MM/YY HH:MM:SS.mm on Highchart
- Highcharts columns with index on each column bottom
- Highmaps occuring 'Uncaught TypeError: undefined is not a function ' and not loading?
- How to display averages in highcharts?
- HighCharts is slow to load data when building multiple charts
- HighCharts Arearange Chart not working
- Isolate a single series on Highcharts line chart
- Highchart Callback Refactoring not working, and how to display multiple series using multiple Ajax data
- how to select a button in highcharts-range selector row and click
- Populating a highchart graph from a linq query
- (how) can we create semi circle donut chart, with range labels?
- Highcharts Change Bar Background Color Based on categories value
- _colorIndex and _symbolIndex when creating object
- Highmaps downloadXLS() issue with MacOS Safari
- Tick and label for every xAxis Unit in Highcharts Chart
- HIGHCHARTS - Value of Columns Based on previous Column Value
- Multiple data in a category in a spline graph
- Highcharts export module giving error
- Highcharts: make y-axis extremes the same for two data series with different units
- Highcharts Error: <rect> attribute x: Expected length, "NaN"
- High charts date getting changed to random years
- Issue with Highcharts master-slave chart
- Adding series dynamically to highcharts using python 3
- Highcharts pattern plugin and wkhtmltopdf
- Getting the corresponding x-axis value from the max value in y-axis in Highcharts
- How to detect double clicks or long clicks on points in Highcharts charts?
- How add custom content HighCharts PDF export?
- HighChart - Stacked Bar chart - To show dash line over the bar chart to the specific portion in the bar