This project has moved. For the latest updates, please go here.

Set Height and Width Pie Chart

Topics: Web Controls
Jun 19, 2007 at 11:00 AM
Edited Jun 21, 2007 at 11:29 AM
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 8: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.