dmca dmca - 2 months ago 22
R Question

How do I adjust the initial range in hc_navigator

I am using the highcharter package (which is awesome) to plot time series data in R and have added a navigation to my chart using the following function:

hc_navigator()


I want to pass in an argument that specifies the initial focus of the range of the navigator.

This is an example of what I am trying to accomplish:

http://jsfiddle.net/gh/get/jquery/1.7.2/highslide-software/highcharts.com/tree/master/samples/stock/navigator/series-data/

Notice that navigator range defaults to 3 months, rather than the entire series.

I looked through the documentation and I couldn't find a way to do this.

Answer

First, is not the hc_navigator.

You need to search about highstock set default zoom in google which lead you to this highcharts question/answer Highstocks - How to change the default Zoom. You need to use rangeSelector options.

So in highcharter: hc_rangeSelector(selected = 2).

Hope this helps you.