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

Message ListMessage List     Post MessagePost Message

  New feature for scatter diagram to zoom in a specific area selected by mouse
Posted by stirwl on Jan-02-2024 10:01
Hello,
I saw another GUI scatter diagram.
The diagram can zoom in selected data area and show select track after using mouse select an irregular region.
How about add this feature to ChartDir?

  Re: New feature for scatter diagram to zoom in a specific area selected by mouse
Posted by Peter Kwan on Jan-02-2024 18:32
Hi Stirwl,

Are you referring to the feature as demonstrated in the following sample code?

https://www.advsofteng.com/doc/cdnet.htm#xyzoomscroll.htm

(Note: The above is from ChartDirector for .NET. There are similar examples in all ChartDirector editions that support GUI.)

Best Regards
Peter Kwan

  Re: New feature for scatter diagram to zoom in a specific area selected by mouse
Posted by stirwl on Jan-03-2024 13:05
Yes, that's it.
I think a rectangle selection is fine enough, though an irregular region selection is fancier.

  Re: New feature for scatter diagram to zoom in a specific area selected by mouse
Posted by stirwl on Apr-02-2024 09:22
Hello, I have another two questions.
1. Can I know which data is in the selected area?
2. Can I use an irregular region to select data?

  Re: New feature for scatter diagram to zoom in a specific area selected by mouse
Posted by Peter Kwan on Apr-03-2024 09:26
Hi stirwl,

1. You can ask ChartDirector for the bounds of the selection rectangle, that is, the left and right x coordinates, and top and bottom y coordinates. You can then iterate your scatter points to find out which ones are inside the bounds.

The "Simple Zooming and Scrolling" sample code illustrate how it select the data within the x bounds. (It only uses the x bounds because this example is horizontal zoom only.) In your own code, you can get the y bounds too.

https://www.advsofteng.com/doc/cdnet.htm#simplezoomscroll.htm


2. ChartDirector does not have a built-in user interface for the user to use the mouse to construct an irregular region. It can draw an irregular region if your code can provide the coordinates. That means if you can develop a user interface for the user to define an irregular region using normal mouse events (mouse down/up/move), it can be visualized on the chart. You can then iterate your scatter points to determine which points are inside the selected region. (There are well known algorithms to determine if a point is inside a polygon.)


Best Regards
Peter Kwan