This project has moved and is read-only. For the latest updates, please go here.

Set Height and Width Pie Chart

Topics: Web Controls
Jun 19, 2007 at 12:00 PM
Edited Jun 21, 2007 at 12:29 PM
I am working on SharpMap.I have generated Map on SharpMap ajaxmap Control and also Pie Chart on it.but when Map Zoom's In or Out,the Size of Pie Chart remains same. So I want's to Increase or decrease the Size according to zoom level of Map. for generating pie Chart I am using Radgraph.dll.
Can anyone suggest me how can I set the Height and Width for pie Chart according to Zoom level,so that Pie Chart also Zoom's In and Out According to Map.

Jun 19, 2007 at 9:22 PM
It seems that you want to know the scale of the map given the Zoom?

In versions <= 1.0, the Zoom property equals the number of world units wide the Map is. If you divide this number by the width of the view in pixels, then divide that by the dots per inch in your display, you get a reasonable approximation of the scale (although not very accurate, since an "inch" isn't an inch on displays: it's all relative to the display).

Performing the operation in reverse to compute the desired world width and calling setting Zoom with the resulting value will zoom your map.

To keep the pie chart synchronized, you'll need to subscribe to the MapViewOnChange event, of course.