ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  need help with multiple WebChartViewers per page
Posted by Lisa Henry on Dec-05-2007 07:57
Hello,

I am using using the WebChartViewer object to create several zoomable line charts.  I'm essentially borrowing the demo code, and I'm using the perl library on linux.  If I post one chart per page, everything works as expected. But if I put two charts on the page, only one of them works.  For both charts, the buttons table and the images are drawn, but only the first chart has its buttons successfully connected to the viewer.  The second chart does not respond to zoom or scroll actions.

First of all, should this work?

If so, should I have one set of buttons for each image, or one master set of buttons for all images?

Is there anything I need to change in the javascript demo to allow more than one viewer to exist per page?

Thanks in advance,
Lisa

  Re: need help with multiple WebChartViewers per page
Posted by Peter Kwan on Dec-06-2007 09:39
Attachments:
Hi Lisa,

Basically, if you duplicate the HTML and charts, you just need to ensure the duplicate the necessary code as well, as you rename the variables to ensure they do not conflict. For example, in the original "Zooming and Scrolling Demonstration" sample code, the scroll button HTML element is called "ViewerMouseUsage1_Scroll" as follows:

<div class="chartPushButton" id="ViewerMouseUsage1_Scroll" title="Pointer">

If you duplicate the button, make sure the other button is called something else, not just copy and paste the code. Then you need to adjust the Javascript/Perl code to you the name you have chosen.

I have attached an example for your reference. Basically, I just duplicate the code and adjust the variable names to avoid conflict.

Hope this can help.

Regards
Peter Kwan
zoomscrolldemo.pl
zoomscrolldemo.pl

44.72 Kb