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

Message ListMessage List     Post MessagePost Message

  Lasso tool in charts
Posted by Aldy on Nov-07-2011 17:33
Hi Peter, is it possible in chart director to lasso some points in a chart(e.g. scatter). If yes, it would be great if you
can provide working sample code for this as my reference coz I'm still learning ChartDirector.
Regards.

  Re: Lasso tool in charts
Posted by Peter Kwan on Nov-08-2011 03:05
Hi Aldy,

By "lasso some points in a chart", do you mean to allow the user to select some points interactively using the mouse?

For a web application, ChartDirector can generate an image map for the data points, so that the points can have mouse events (like mouse click, mouse move, etc). You can add any Javascript code to the mouse event handler you like. For example, when the user clicks on a point, you can run some Javascript code that puts a rectangle around the point. (In HTML, a rectangle can be created using an empty DIV block with a black border.) There is an example "Javascript Clickable Charts" that demonstrates how to add Javascript mouse handlers to the data points.

Also, in the "Zooming and Scrolling Demonstartion (2)" sample code, the user can "drag a rectangle" on the chart and inform the server the position of the rectangle. In the original sample code, the server will zoom in to the selected region. You may modify the code so that the server handles the selected region differently. For example, it can search the scatter points to determine which points are in the selected region, and then perform something on the points.

Unluckily, I do not have any sample code that exact matches your requirement. So you would probably need to develop the exact code yourself.

Regards
Peter Kwan