score:7
instead of using .rangeselector({settings})
, use the .clickbutton
function:
chart.rangeselector.clickbutton(0,{type: 'month', count: 1},true);
however, this function seems to be somewhat strange and undocumented from what i can tell.
it accepts the following arguments:
* @param {number} i the index of the button
* @param {object} rangeoptions
* @param {boolean} redraw
redraw
defaults to true, and i
will just visually select one of the buttons (other than that, it seems to do nothing). the bread and butter seems to be in the rangeoptions, which is an object with a type and count. for instance, in the example above, it selects the most recent 1 month. other available options are:
* millisecond
* second
* minute
* hour
* day
* week
* month
* ytd
* year
* all
however, please note that you cannot .destroy();
the range selector and have this still work, you would possibly have to do a little bit of hacking to get that to work.
here is a jsfiddle illustrating it: http://jsfiddle.net/hfpr2/
score:0
in case when you destroy rangeseletor object, it is not possible to display object which doens't exist. so if you woudl like to display rangeselector only what you need is enable it by http://api.highcharts.com/highstock#rangeselector.enabled.
score:0
to use the clickbutton() you need to call it like this...
chart.rangeselector.clickbutton(0, chart.rangeselector.buttonoptions[0], true);
where the buttonoptions[] item matches the first parameter.
score:1
you don't have to give the rangeselector the options to use. you can simply call:
chart.rangeselector.clickbutton(0, true);
thus the first button will be clicked while using its current options.
Source: stackoverflow.com
Related Query
- how to set a rangeSelector for highstock
- How to dynamically adjust dataGrouping and set variable time intervals for HighStock data (HighCharts)
- How to set xAxis maxRange/minRange for each rangeSelector button separately
- Highcharts - How to set custom colors for the series
- How do I set a minimum upper bound for an axis in Highcharts?
- How to set a static minimum value for axes in Highcharts
- How to position RangeSelector / zoom buttons at custom co-ordinates in Highstock
- How to set the x value for High Charts error bar
- Highchart / Highstock how to set color of individual ohlc or candle?
- How to show plotlines on highstock when its set much higher than the data series?
- How can I set the alignment for individual axis labels in highcharts?
- Set background color for only one pane in multi-pane Highstock chart
- Set position for each flag in highstock
- Highstock flag position not correct for yAxis with top set
- Highcharts - how to set textShadow for data labels
- HighCharts. How to set a fixed width for a chart grid, not including labels?
- how to take only categories for x-axis and remove unwanted scaling in Highstock chart
- How to toggle date input datepicker in Highstock rangeSelector
- HighCharts - how to set labels font color for printing?
- Highcharts. How to set interval for PlotBand?
- How to set column width for columnRange chart with multiple series
- Cannot set Individual Point color in Series for Highstock API, it works for Highchart API
- How can I set the legend symbol color for a series when using colorByPoint?
- How can I set navigator's start&end in Highstock candlestick chart?
- How to set a minimum range in highstock navigator?
- How to set a Maximum yAxis range for HighChart graph?
- How to interpret Timelien for HighStock
- How to set column colors, title colors , font size , font family in external css file for highcharts?
- How to set up drilldown feature for multiple boxplot series in highcharter?
- How to set minutes as units in Highstock chart using data from CSV
More Query from same tag
- Highcharts Annotation Position/Top Is Incorrect Upon Initial Rendering
- How to customize the label for navigator in highstock
- How to update just data attribute under series in highcharts with json?
- Highgraphs dynamically changing type
- Highcharts Default Colors Are Not Same at Pie and Column?
- Highcharts Y Axis Tick Marks not setting
- Background event on Highcharts Gantt
- Remove Zero From the HIGHCHART
- Is there a possibility to display regions in a detailed map (instead of cities)?
- Highcharts - Getting a 3d effect with selected pie chart slices
- How to remove Hyper Link in XAxis name in Highcharts?
- Highcharts Maps labels don't all show
- Understand variable assigment in JS
- Highcharts. Place tooltip on top of all items
- Highstock / Highcharts dataGrouping points outside of viewport / canvas
- Basic highcharts plugin, need to remove line between point
- Highmaps : dataLabels console error
- highcharts tooltip z-index
- Mutiline charts Dynamically from an API request
- HighCharts: get Y and X value
- How to update the colour of minColor and maxColor when data is changed in high charts' solid gauge in ReactJS?
- Long array of small data points is rendered as a jagged line
- Highcharts credits to be enabled while printing
- Wicked-Charts: This website contains interactive content
- Calling function 'ChartModule', function calls not supported
- How do you generate dynamic <style> tag content in Angular template at runtime?
- How to get proper stack labels with 'datetime' axis?
- express json object in highcharts
- How can I add a text link just below the legend box in highcharts
- highcharts - pulling data from HTML but converting the strings to number