score:2
Accepted answer
You could place a JavaScript function in chart.events.load option in Highcharter
. Using Renderer you could add a button that will use setExtremes function on click.
Demo in JSFiddle (without Highcharter
nor `R, data is different, but functionality of the button is the same): http://jsfiddle.net/e69eLm6q/
Code to run in R
:
library("quantmod")
usdjpy <- getSymbols("USD/JPY", src = "oanda", auto.assign = FALSE)
eurkpw <- getSymbols("EUR/KPW", src = "oanda", auto.assign = FALSE)
hc <- highchart(type = "stock") %>%
hc_title(text = "Charting some Symbols") %>%
hc_add_series(data = usdjpy, id = "usdjpy", pointInterval = 36000000) %>%
hc_add_series(data = eurkpw, id = "eurkpw", pointInterval = 36000000) %>%
hc_rangeSelector(buttons=list(list(type='month', text='New', count=2))) %>%
hc_chart(
events = list(
load = JS("function(){
var chart = this;
chart.renderer.button('do stuff',200, 100)
.attr({
zIndex: 3
})
.on('click', function () {
chart.xAxis[0].setExtremes(Date.UTC(1970, 4, 1), Date.UTC(1970, 6, 1));
})
.add();
}")
)
)
hc
Source: stackoverflow.com
Related Query
- Highcharter setExtremes Function in R
- Use highcharter inside a function
- How to create a highcharter event function to create a “dropdown function” in Shiny R
- Highcharter package not found - highchart function not available
- Strange character in the Highstock source code
- Highcharts plotBands do not work with setExtremes function
- could not find function "hc_add_series_density" Highcharter R
- R Highcharter tickmarkPlacement with hchart() function
- How do I attach a click event to the hcmap function within Highcharter library within R shiny?
- Highcharts :Uncaught TypeError: $(...).highcharts is not a function
- How to get rid of Function calls are not supported in decorators in Angular aot compiling?
- TypeError: $(...).highcharts is not a function
- R Highcharter Sankey nodes column property trouble
- Highcharts saying undefined is not a function when trying to add a new chart
- Highcharts 'Reset Zoom' after calling setExtremes
- r - How to set xlim and ylim range in a highcharter plot?
- Optimize JavaScript DrillDown code
- pie chart highcharter R
- Customize bubble map with highcharter
- Execute function after zoom highcharts
- multiple series in Highcharter R stacked barchart
- Serializing a function as a parameter in json using C#
- Uncaught TypeError: e.doDrilldown is not a function - Highcharts
- How to change bin width on R highcharter histogram
- Uncaught TypeError: undefined is not a function - Highcharts - MVC
- Drill down function in highcharts in case of line charts
- Replacing highcharts.each in my code as it is being deprecated
- How to setExtremes in xAxis event handler?
- how to get chart object inside a point event function in Highcharts
- Two y Axis in Highcharter in R
More Query from same tag
- Set Specific Range on X-Axis in HighCharts
- what is datetype is this in highcharts
- How to add another same chart but with different data?
- Is there a way to show overlapping points of the same serie in highchart?
- highcharts scrollbar labels not appearing
- Extra data in point object isn't available for tooltip
- Show specific data in the highchart's title
- Mean Markers in Boxplot with multiple series
- Highcharts series click event not firing on first click
- How can you change the "label" (valueSuffix) on a highcharts gauge after the gauge has been created?
- Producing an area chart in D3 similar to Highcharts Basic Area
- How to remove sliced line from pie high chart if there there is only one object in data
- child_process.execFile is not working with phantomjs and highcharts-convert.js
- Highchart network graph with tooltip when hover on every node
- How to resize card content to its size in material ui?
- Highchart circle position by jquery
- Highcharts small size div not showing minorTickInterval
- Highcharts annotations text to print in graph
- Formatting MongoDB aggregation for Highcharts Stacked Columns
- Displaying MoM in highcharts for uneven months
- How to pass dynamic data in highchart using angularjs?
- Highchart xAxis plotbad with specific heigth
- Highcharts Stack Column Sum Positive and Negative Together
- Cannot add multi series to Highstock but same thing works for Highcharts
- Highcharts y-axis's max value is not what I expect it to be
- How to force the navigator to show a full year timeline even if the data collectively within it doesn't span an entire year
- PHP Return JSON with ? as callback
- JQuery-UI Slider Auto Increments But Does Not Fire Slide Event
- Missing points in HighCharts when applying event to exported button
- Highcharts x axis categories