score:8
It looks as though you're trying to show one data point per month. If this is the case, I would recommend assigning each data point a time and changing the date formatter.
//Example 1: Each data point has a time, with a date formatter:
var chart = new Highcharts.Chart({
chart: {
renderTo: 'container'
},
xAxis: {
type: 'datetime',
dateTimeLabelFormats: { //custom date formats for different scales
second: '%H:%M:%S',
minute: '%H:%M',
hour: '%H:%M',
day: '%e. %b',
week: '%e. %b',
month: '%b', //month formatted as month only
year: '%Y'
}
},
series: [{
data: [
{x: Date.UTC(2010, 0, 1), y: 1}, //one data point for each month
{x: Date.UTC(2010, 1, 1), y: 4},
{x: Date.UTC(2010, 2, 1), y: 9},
{x: Date.UTC(2010, 3, 1), y: 16},
{x: Date.UTC(2010, 4, 1), y: 25},
{x: Date.UTC(2010, 5, 1), y: 36}
]
}]
});
However, it also seems you want to zoom down to the 'day' level. If this is the case, it makes sense to add all your data points to the series, and use highcharts' zoomType
property, perhaps in combination with the date formatter.
//Example 2: Each data point represents a day, and we use the 'zoomType' feature:
var chart = new Highcharts.Chart({
chart: {
renderTo: 'container'
},
xAxis: {
type: 'datetime',
zoomType: 'x'
},
series: [{
data: [
{x: Date.UTC(2010, 0, 1), y: 1}, //one data point for each day
{x: Date.UTC(2010, 0, 2), y: 1.1},
{x: Date.UTC(2010, 0, 3), y: 1.4},
{x: Date.UTC(2010, 0, 4), y: 1.8},
{x: Date.UTC(2010, 0, 5), y: 2.5},
{x: Date.UTC(2010, 0, 6), y: 3.8}
]
}]
});
score:2
I think this will work:
You can pass your data as a pair of timestamp and value, check this example: http://jsfiddle.net/CAKQH/310/
Source: stackoverflow.com
Related Query
- highcharts zoomable 6 month line graph
- missing value in highcharts line graph results in no line, just points
- How do I set highcharts line graph point colors to an array of colors?
- Creating a line graph with highcharts and data in an external csv
- Highcharts - Line Graph Marker Rendering Unreliable?
- Bottom (xaxis) line of Highcharts graph should disappear
- How to make legend color show up in Highcharts for a line graph under certain conditions?
- How to Display Month and Year in xAxis of Highcharts datetime graph
- Show only discontinuous points in Highcharts line graph
- Highcharts - verticalAlign on dataLabels not working on line graph
- How do I use dates from a LinkedHashMap for the x-axis on a Highcharts line graph (using Thymeleaf)?
- how to continue the graph line when missing series of data in middle of highcharts
- How to draw a line on a highcharts graph from an AJAX call?
- highcharts multiple line live graph
- How to stop plotting the graph if data is blank and continue if data is there on the y-axis in base line highcharts
- Adding Date Labels to a HighCharts line graph
- Highcharts - Show a string category label in the tooltip for a line graph
- Trouble getting unique tooltip based on X axis values in highcharts line graph
- How to add labels to the end of a highcharts line graph
- Getting highcharts to re-animate a line graph
- Highcharts plot offset on line graph with categories
- highcharts line graph with ajax
- Highcharts redraw and sort data on draggable line graph
- a multi line graph in highcharts
- Multiple series of data in Highcharts but second line graph is displayed squashed?
- HighCharts Bubble graph JSON as data source
- How to modify the code so that Highcharts graph does not cover fixed navigation bar at the top of the page?
- HIGHCHARTS How to to make separate colors for shaded region and the line in Area Graph
- How to use ajax call to populate line graph in highcharts
- HighCharts multiple x series data for line graph
More Query from same tag
- How to add hyperlink to each part of high-chart's stacked bar chart in php
- Highcharts - How to specify dimensions of rectangles
- Highcharts Error #16: charts not showing on the same page
- Text Ellipsis in bubble chart
- How to make Highcharts default pie not show when Angular page loading
- How to skip a value in highcharts.js?
- Highcharts Multiple Bar Colours in X-Range
- Loading Highcharts via shim using RequireJS and maintaining jQuery dependency
- Highcharts bubbles incorrect initial size, changes on resize
- How to connect/sync xAxis crosshairs between multiple HighStocks charts
- Is it possible to style columnrange highchart to change color when data is below 0?
- Uncaught SyntaxError: Unexpected token ILLEGAL in javascript
- In polar chart, connect each series on base with an individual line
- Highcharts - Adding tooltip to ONLY certain dynamically added series
- Highcharts xAxis drilldown dont change correctly
- How to email any chart using Highcharts?
- How to Change Highchart Column Color Dynamicly
- Highcharts Pulling JSON data into series names dynamically
- Highcharts: move renderer (custom drawn)
- Why chart is not rendered correctly after export?
- Tooltip Hover State
- What's the matter with the STEP parameter in my Highcharts graph?
- Where to find charts plug-in like this?
- Highcharts value bars with full height background bars
- Highcharts lines not being drawn until browser is resized
- Javascript - Page slow to show after not being the active tab
- Highcharts dynamic binding in c# or json
- How Can we display blocked area for particular timeline in horizontal bar in gantt highchart
- Javascript: Plotting data from a variable using HighCharts- no data passing
- passing json values to highcharts from .net code behind