|
What determines height of zoom selection rectangle in cdjcv.js? |
Posted by kenyee on Feb-11-2011 07:24 |
|
Hopefully a simple question, but what determines the height of this in zoom mode?
I have a multichart (two charts stacked on top of each other but rendered in a single chartviewer). I think I grabbed most of the code in the scrollzoomdemo properly but it's acting like scrollzoomdemo3 on the top chart.
I.e., in zoom mode, when I hover over the top chart, the cursor changes to the + zoom icon, but when I hover over the bottom chart, it shows a regular mouse cursor.
So when I drag to select an area, it only puts the selection rectangle over the top chart instead of both top and bottom.
The same thing happens when I try xy zoom mode...the cursor icon only changes if I'm over the top chart.
So the cdjcv.js code seems to think my chart only includes the top chart in the multichart :-P |
mChart.setMainChart(cTop); |
Posted by kenyee on Feb-11-2011 07:33 |
|
Found it...when you do this, it only displays the zoom selection rectangle over the top chart.
Is there any way to switch this on the fly? I.e., change it in client side javascript? I want it to show the x-y zoom only on the top graph, but for the X-axis zoom, I want the selection rectangle to cover both charts... |
Re: mChart.setMainChart(cTop); |
Posted by Peter Kwan on Feb-12-2011 06:09 |
|
Hi kenyee,
To have the selection rectangle covers both charts in a MultiChart, you can create an additional transparent XYChart whose plot area is the region that you want the selection rectangle to cover, and then add that transparent XYChart to the MultiChart, overlapping with the existing charts. You can then set the main chart to that transparent chart. In this way, the selection rectangle will be based on the plot area of the transparent chart, which covers both charts.
Unluckily, you cannot switch the selection rectangle using Javascript code. It needs to be done on the server side. That means if you would need to reload the web page so that the server has a chance to use setMainChart to set another main chart. (That is, when the user switch from X-Zoom to XY-Zoom, you may need to reload the web page.)
Hope this can help.
Regards
Peter Kwan |
thanks |
Posted by kenyee on Feb-12-2011 06:14 |
|
I think what I have is enough...would have been nice to be able to switch it w/ client side javascript, but it should be ok...
ken |
|