I have pieced together bits of code (am a newbie) to create a series of drop down lists that are used to navigate to sections of an interactive chart. It uses the onClick event to make a selection. I'm wondering if anyone has a idea about the best way to get this to function in Safari and Chrome (it works perfectly on Firefox and Opera).
I have included an example of the code for zooming by month, but I also have an option for zooming by fortnight, week and day. The code is found below.
var minDate = g.xAxisRange()[0];
var maxDate = g.xAxisRange()[1];
var minValue = g.yAxisRange()[0];
var maxValue = g.yAxisRange()[1];
showDimensions(minDate, maxDate, [minValue, maxValue]);
function showDimensions(minDate, maxDate, yRanges) {
showXDimensions(minDate, maxDate);
showYDimensions(yRanges);
}
function showXDimensions(first, second) {
var elem = document.getElementById("xdimensions");
elem.innerHTML = "dateWindow : [" + first + ", "+ second + "]";
}
function showYDimensions(ranges) {
var elem = document.getElementById("ydimensions");
elem.innerHTML = "valueRange : [" + ranges + "]";
}
I haven't actually run this code myself so it may not work exactly the way it is, but the logic is there.
I've been working on this option before trying the event delegation - only because its going to take me a while to learn what's going on in that option (yup, I'm really new at this..).
The only thing with the jQuery code is that when I select a month (as in the example) the chart goes blank. I've attached an example of how the chart should look and also how it looks after selecting a month using the jQuery code above. Would it be possible to provide a clue as to what may be going wrong?
Bookmarks