score:59
you will need to set the xaxis.ordinal
property to false
, this is true
by default. true
value indicates the points should be placed at fixed intervals w.r.t space (pixels), and false
changes points to be placed at fixed intervals w.r.t. time
xaxis: {
ordinal: false
}
score:0
it is possible to zoom your chart using highcharts javascript library. the property that you should set is zoomtype
decides in what dimentions the user can zoom by dragging the mouse. can be one of x, y or xy. defaults to "".
here you can see an exmaple here. in order to zoom a specific place, hold the mouse left button and select the area you want to zoom.
html code:
<div id="container" style="height: 400px"></div>
javascript code:
$(function () {
var chart = new highcharts.chart({
chart: {
renderto: 'container',
type: 'line',
zoomtype: 'x'
},
xaxis: {
categories: ['jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sep', 'oct', 'nov', 'dec']
},
series: [{
data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4]
}]
});
});
also, a "reset zoom" button is automatically shown on zoom event and it's easy to manipulated what part of the chart will be shown when it is pressed.
anyway, for more information and examples of zoom settings, event and the button you should refer to "highcharts options reference" here. just enter "zoom" in the search.
as to your other question: "how to make the stockchart linear" according to highstock api the default type of the chart is linear. what is happening here is caused by the area option that you have set in the series property. just remove in like this and you will get your linear chart:
$(function() {
var chart2 = new highcharts.stockchart({
chart: {
renderto: 'chart2'
},
rangeselector: {
selected: 0
},
xaxis: {
type: 'datetime'
},
series: [{
name: 'val',
data: chart_arr
}]
});
});
Source: stackoverflow.com
Related Query
- Highstock highcharts irregular data gets wrong x-scale
- Highcharts Time Data With Irregular Intervals In Wrong Order
- HTML table as data source for highstock charts using highcharts
- Highcharts : Showing wrong color in data series
- Highcharts - Global configuration with common code and unique data & Headings
- Highcharts 3d bar chart data labels position is wrong
- highcharts gets my hour time wrong
- Highstock Highcharts date time data on Xaxis
- How to process csv data (datetime) month, week, day, hour in highstock highcharts
- Wrong data display when i set multiple series type in highstock chart
- Highcharts display label for pie chart using html table as data source
- Same data in HighCharts and HighStock
- Include additional highcharts source data in angular2 app
- Highstock weird y-axis scale difference in same data dual series
- Strange character in the Highstock source code
- Highcharts - Highstock chart showing double line on hovering data points to show tooltip
- Loading string data from table gets parsed as Date on Chrome - Highcharts
- Highcharts series visibility with csv data source
- Highcharts / Highstock datetime null data connected even with connectNulls: false
- How to change line color when loading static csv data into Highcharts Highstock graph?
- Dates not displaying correctly in Highcharts plot with irregular time data
- How to have multiple highcharts with different series data in vuejs without repeating code
- Big data amounts with Highcharts / Highstock (async loading)
- Irregular time data in highcharts
- highcharts x-axis is displaying the wrong data
- Using a flask variable as data source for highcharts
- Highcharts Highstock How to Plot OHLC and Line Charts from One Set of Embedded CSV Data Using Series Map Tools?
- Highcharts plotOptions.pie.dataLabels.formatter gets called multiple times for same data
- Error: Data source must be a URL for refresh | console error | javascript | Highcharts
- Highcharts cloud issue with data source when duplicating chart
More Query from same tag
- Highcharts : I am changing x-axis label, why are the label's not showing up?
- Unable to apply custom pipe to high chart tooltip values
- highcharts breaking when I input seconds
- How to create js.Array inside js.Array in scalaJS for highcharts as specified in the documentation?
- How can I achieve this using HighCharts library
- How can I get access to a Highcharts chart through a DOM-Container?
- Angular-Highcharts: Chart Pie is not working when change between tabs
- Highcharts tooltip get position and change class
- what should be the initial dataset from millions of data points for stock line highcharts
- Highcharts event redraw/load with reflow, and Angular
- Style dash in highchart graphic
- highchart json data points
- Incorrect JSON data format
- problems charts jquery highcharts
- DataLabels formatter not working in Highcharts Sankey Diagram
- How do I make a Highcharts timeline where the labels don't overlap and none are hidden?
- How to align lines marker in middle/centre of the bars - High Charts
- Highcharts - Export CSV include additional data
- plotOptions.series.point.events returns null point data when using a drilldown
- Highcharts display series.name on X Axis
- Like to show all the labels of x axis in highchart
- how to add onclick event handler inside highcharts tooltip
- Highcharts JSON multiple series
- Native Android SDK graph
- highcharts use variable as chart title
- Highcharts / highstock how to change title of chart in IE?
- Can I create multiple dynamic carts with Highcharts
- Best way to add different colours based on conditions to bargraphs plotted with Highcharts.js
- Highchart error Uncaught SyntaxError: Unexpected number
- Hide the highcharts tracker from image