[email protected]
Posts: 30
Joined: Sat Sep 12, 2015 10:29 pm

Use highslide with zoomed highcharts?

I use this technique to achieve highslide effect on my highchart:
events: {
click: function() {
debugger;
var container = this.renderTo;
var containerId = $(container).attr("id");
var currChart = $(container).highcharts();
hs.htmlExpand(document.getElementById(containerId), {
width: 9999,
height: 9999,
allowWidthReduction: true,
preserveContent: false
}, {
chartOptions: currChart.userOptions
});
}
}

hs.Expander.prototype.onAfterExpand = function() {
debugger;
if (this.custom.chartOptions) {
var chartOptions = this.custom.chartOptions;
if (!this.hasChart) {
chartOptions.chart.renderTo = $(".highslide-body")[0];
chartOptions.chart.events.click = function() {};
var hsChart = new Highcharts.Chart(chartOptions);
}
this.hasChart = true;
}
};



It's working fine except after I zoomed my chart and I clicked the Reset zoom button, the pop up still showed up instead of the chart got zoomed out. How can I have that pop up after I click everywhere within the chart except the button Reset zoom's place and the legend too?
Attachments
ZoomedHighchart.png
ZoomedHighchart.png (25.25 KiB) Viewed 2024 times
User avatar
KacperMadej
Posts: 4632
Joined: Mon Sep 15, 2014 12:43 pm

Re: Use highslide with zoomed highcharts?

Could you post live example, like jsFiddle?
Kacper Madej
Highcharts Developer
[email protected]
Posts: 30
Joined: Sat Sep 12, 2015 10:29 pm

Re: Use highslide with zoomed highcharts?

Here it is: http://jsfiddle.net/roadrash/GqhEX/
Probably I need to clarify my need: When I click on Reset zoom button, I only want my chart gets reset to it's normal size, I dont want the pop-up to appear. In another words, the popup should only appear after I click anywhere in the chart except the Reset button. The same thing with legend name.
Thanks
User avatar
KacperMadej
Posts: 4632
Joined: Mon Sep 15, 2014 12:43 pm

Re: Use highslide with zoomed highcharts?

To disable pop-up on the Reset button you could check what has been click to verify that pop-up should be displayed e.g. by checking class of the target. In your case click event is triggered only if backgroud is clicked.
Example: http://jsfiddle.net/aavut3t8/

Similar topic: http://forum.highcharts.com/highstock-u ... art-t33714
Kacper Madej
Highcharts Developer

Return to “Highslide JS Usage”