Hi ,
using ZedGraph i drew the Pie Chart on the Map using Data from Sql server.
but i want to draw bar Chart , can any one help me on this issue.
Thanking you.
Hi ,
using ZedGraph i drew the Pie Chart on the Map using Data from Sql server.
but i want to draw bar Chart , can any one help me on this issue.
Thanking you.
Mahender,
Here is a simple sample for you, if you want to make the bar more beautiful, please have a look at the documents of ZedGraph which is our internal engine for drawing bar/pie charts.
zedgraph.org/wiki/index.php?title=Main_Page
The source code of ZedGraph is shipped with our product which you can get here:
C:\Program Files\ThinkGeo\Map Suite Desktop Full Edition 3.0 (BETA)\Miscellaneous\Sources & License\ZedGraph Source & License
SnapShot of the attached Simple Demo
Please let us know for more queries.
Thanks,
Ben
303-ShowBars.zip (13.1 KB)
Good day,
I wanted to do a passage line statistics in the ocean to display the number of different type of ships passing a given line for a given timeframe. The X axis represents time and the Y axis represents number of vessels, but the X axis should be along the passage line I draw on the map, so the X axis can be any directions not always horizontal. Once the histogram is presented, the user can select any bar to see more details.
Is it possible to draw this kind of bar graph on the map? Any info is greatly appreciated.
Rose
Rose,
The Y axis is always vertical to X axis no matter X is horizontal or not, right? I think you can get the horizontal graph first and then rotate it a proper degree to make the X axis along the passage line. Here is some code how to rotate a bitmap, the rotating degrees need to be calculated.
// Get the bitmap from the Zed Graph
Bitmap bitmap = zedGraph.GraphPane.GetImage();
// Rotate the bitMap for 90 degrees
GdiPlusGeoCanvas gdiPlusGeoCanvas = new GdiPlusGeoCanvas();
Bitmap rotatedBitMap = new Bitmap(bitmap.Width, bitmap.Height);
gdiPlusGeoCanvas.BeginDrawing(rotatedBitMap,new RectangleShape(), GeographyUnit.Meter );
gdiPlusGeoCanvas.DrawScreenImageWithoutScaling(bitmap, bitmap.Width * 0.5f, bitmap.Height * 0.5f, DrawingLevel.LevelOne, 0, 0, 90);
gdiPlusGeoCanvas.EndDrawing();
// Set the rotated bitmap for each feature
e.Bitmap = rotatedBitMap;
As each bar chart is a picture on map, a specific bar cannot be selected. But by implementing the Map1.MapClick event, it’s easy to select the nearest feature and get the info of that point. So you can still click to select and show the detailed info.
Thanks,
Ben
Thanks Ben for your help.
You said: "By implementing the Map1.MapClick event, it's easy to select the nearest feature and get the info of that point. So you can still click to select and show the detailed info."
I am still not quite sure about this,the bar chart is a picture on the map, when I select the nearest feature where clicked, the whole picuture will be selected. How to get and highlight the exact bar that selected?
Thanks
Rose
Rose,
Sorry for the confusing. I mean you cannot select a specific bar in the chart, but you can select the point and get all the corresponding info of that point. That’s kind of a workaround but I’m not sure that meets your requirements.
Thanks,
Ben
Hello,
i can’t download the sample. Is it possible to post the code?
the next question is, where can I download ZedGraphStyleExtension.dll? I can’t find it on zedgraph.org.
Thanks for your help.
Rahim
Rahim,
Thanks for your interests in MapSuite component and welcome you to ThinkGeo MapSuite Destkop Discussion forum.
Why you cannot download the sample zipped? I tried again and it can be downloaded. The ZedGraphStyleExtension.dll is a wrapper DLL for ZedGraph, it is not an open source project. You can find it in our package after you install it.
Thanks.
Yale