score:2
Accepted answer
in the setextremes you can check which button is selected by code:
xaxis: {
events: {
setextremes: function(e) {
console.log(this);
if(typeof(e.rangeselectorbutton)!== 'undefined')
{
alert('count: '+e.rangeselectorbutton.count + 'text: ' +e.rangeselectorbutton.text + ' type:' + e.rangeselectorbutton.type);
}
}
}
}
you can render your own buttons by:
normalstate = new object();
normalstate.stroke_width = null;
normalstate.stroke = null;
normalstate.fill = null;
normalstate.padding = null;
//normalstate.r = null;
normalstate.style = hash('text-decoration', 'underline');
hoverstate = new object();
hoverstate = normalstate;
pressedstate = new object();
pressedstate = normalstate;
chart_1mbutton = chart.renderer.button('1m', 96, 10, function() {
chart.xaxis[0].setextremes(1344527940000, 1346342400000, true);
unselectbuttons();
chart_1mbutton.setstate(2);
}, normalstate, hoverstate, pressedstate);
chart_1mbutton.add();
function unselectbuttons() {
chart_1mbutton.setstate(0);
}
score:0
you can do something like the following:
var urls = {
'1m': 'url1',
'3m': 'url2',
'6m': 'url3',
'ytd': 'url4',
'1y': 'url5',
'all': 'url6'
};
$('.highcharts-button').on('click', function() {
var selected = $(this).find('tspan').text()
$.getjson(urls[selected], function(json) {
// set new data
});
});
this way you'll get the url according to the selected button.
Source: stackoverflow.com
Related Query
- how do you create custom buttons with highcharts that each data buttons calls anather php script for its data
- how do you create muliple charts with the same options but with different data
- In highcharts how can I provide data with values x, y, title so that I can put the title in the tooltip?
- How to have multiple highcharts with different series data in vuejs without repeating code
- how to create a column char with highcharts where each column has a different color
- How do you create a Hight Charts chart that updates every second with real data?
- how do you create a link on highcharts to open up pop up window with another chart
- How do you get the mouse hovered label value with the highcharts custom event plugin?
- Highcharts with data from table, how to add custom marker for specific value from specific series?
- How do you change the colour of each category within a highcharts column chart?
- HighCharts - How to create dynamic chart that exports EVERYTHING
- Highcharts custom visuals with Data binding PowerBI
- How to pass custom data into Highcharts graph click event
- How to structure Angular with Highcharts and lots of dynamic data
- Highcharts - Global configuration with common code and unique data & Headings
- How to populate a Highcharts axis with string formatted data from a PHP array
- How to handle HighCharts zooming with large data sets
- How can I force ticks/grid lines on a Highcharts datetime X axis to arbitrarily line up with data points?
- How to Build a Column Chart in Highcharts with Data Entered Dynamically Within a CMS
- How to input plot data into highcharts with rails
- Highcharts - how to create multiple y axis and group the data series
- How to align Highcharts datetime x-axis with data I pass to it?
- HighCharts & MVC: How to load whole graph definition and data with JSON?
- How to use Highcharts React to create chart with multiple lines for same XAxis?
- Exporting with custom data label image in highcharts gantt
- How to create data in Json format for highcharts
- How to create a single series bar graph with Highcharts
- how to create highcharts formatted json structure with python
- Highcharts bar with negative stack: how to position data labels
- How to specify a range of data when using HighCharts with <table>?
More Query from same tag
- Density Plot in R Highcharter
- HighChart Sparkline Chart with dynamic data for the table
- trying to use highchart xrange to display large number of categories
- How do I use verticalAlign on a non-floating title/subtitle?
- How to create a semi circular gauge using high chart?
- combine and merge two array into set of arrays for Highchart Pie
- Inserting mouseover event to custom label created with SVGRenderer, highcharts
- extending highcharts with an ajax load event
- Call asynchronous functions inside loop
- Highcharts Waterfall graph using a column graph
- Http call from a service inside a directive controller
- Convert the y-axis values to Millions in dual axis high charts
- Highchart : sunburst chart not displaying
- Highcharts - stacked columns by category
- How to prevent highcharts from shortening labels with ellipsis
- How to plot AM,PM labels in HighChart?
- Angular Highchart - Set Timezone
- How to get Number of new users per day to DotNet.HighChart
- High Charts Line Chart with missing data
- Displaying marker with text in highchart gauge vuejs
- Charts not responding on the web page after printing them
- Style dash in highchart graphic
- Get the x axis range on selecting a zoom range in Highcharts
- Add CSS to a specific series' legend label in Highcharts
- Multiple data series and multiple data tooltip with HighMaps
- Remove day name from highstock chart tooltip
- Implementing Custom Temperature Gauge with Angular 4 and HighCharts
- How can I remove the legend symbol for a SINGLE legend in Highcharts?
- How to provide padding to the tickPosition on highchart?
- Highcharts multiple series and axes types overlapping