Register  |  Login
ThinkGeo - GPS Tracking and Mapping Solutions  |  Visit the Wiki  |  Find us on: Twitter Facebook Google+ LinkedIn

Discussion Forums

The online community for users of Map Suite GIS components

Zedgraph move charts
Last Post 09-03-2012 06:37 PM by Gary. 10 Replies.
Printer Friendly
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
PhilUser is Offline
Level 2
Level 2
Posts:33
Avatar

--
07-03-2012 04:56 PM

Hi All,

I am trying to allow users to offset pie/bar charts which I am creating with the Zedgraph library and also to enable the user to drag/drop them if they are cluttered etc.

I was looking at creating a "ChangeChartPosition" routine like the one in the Zedgraph sample which changes the label position. I notice that the ZedGraphStyle doesnt have an XOffsetInPixel as the TextStyle does. So how can I do this?

As far as being able to move the charts by hand, they are being drawn to the layer at bitmaps right, so is this actually possible?

thanks

Phil

DavidUser is Offline
MVP
MVP
Posts:1534
Avatar

--
07-03-2012 10:45 PM
Phil,

We have added and XOffsetInPixels and a YOffsetInPixels to the ZedGraphStyle in version 6.0.51.0 and higher. It should be ready in the next 24 hours. There is another trick you can do if you have a build from when we introduced the Feature as a class. The trick is in the ZedGraphDrawing event you can modify the Well Known Binary of the feature that gets passed in through the event arguments. This allows you to move the feature which will allow you to change where the style is drawn. Of course this is in world coordinated and you would have to figure out how many pixels per world coordinate step but it is doable. Anyway I would just wait for the new daily build version and use the new offset properties.

David
- Need sample code? Check out the Map Suite Code Community at http://code.thinkgeo.com
PhilUser is Offline
Level 2
Level 2
Posts:33
Avatar

--
07-03-2012 10:54 PM

Thanks for the reply David.

And how about if users want to move them individually?

Phil

DavidUser is Offline
MVP
MVP
Posts:1534
Avatar

--
07-03-2012 11:06 PM
Phil,

To handle the case where you want to move them individually I went ahead and added an XOffsetInPixel and YOffsetInPixel to the ZedGraphDrawingEvetnArgs. In this way you can control it feature by feature or set a global offset on the style. These new properties will come in the same build.

David
- Need sample code? Check out the Map Suite Code Community at http://code.thinkgeo.com
PhilUser is Offline
Level 2
Level 2
Posts:33
Avatar

--
07-04-2012 04:10 PM
Hi David,

This sounds great. The charts that we actually see within a wpfmap control are bitmaps drawn as a style on the layer if I understand correctly. How am I able to firstly determine if a user is trying to move a chart, and then secondly feed that information back to the correct ZedGraph so it can be redrawn?

In regards to the development builds, I only have access to 6.0.45, will this shortly jump straight to the 6.0.51 build you are referring to?

thanks

Phil
DavidUser is Offline
MVP
MVP
Posts:1534
Avatar

--
07-04-2012 09:18 PM
Phil,

You are correct in that the graph is created as a bitmap and displayed on the map. We do not have the ability, out of the box, to move the chart around based on the user. If you did want to allow the user to move the graphs around it could be accomplished but you would need to make a few changes.

You would need to create a new InteractiveOverlay that would associate with it another copy of the feature layer. This interactive overlay would be responsible for drawing the graphs and also responding to click and drag events to know how to move the graph. It would then store the users defined offset so when it draws again it would apply the offset. I'm not sure how hard it would be without the ZedGraphStlye code however. This might be short professional services project. I could also see if we could expose the ZedGraphStyle as it would make it easier for you to build it.

David
- Need sample code? Check out the Map Suite Code Community at http://code.thinkgeo.com
PhilUser is Offline
Level 2
Level 2
Posts:33
Avatar

--
07-04-2012 11:58 PM
Thanks David. I will have a closer look and get back to you if I have any problems.
GaryUser is Offline
MVP
MVP
Posts:1914
Avatar

--
07-05-2012 03:58 PM
Hello Phil.

You are welcome, please feel free to let us know your problem.

Regards,

Gary

Need to know how to do something with Map Suite? Check our Wiki Code Samples Library and view the source code of any sample right in your web browser.

BimalUser is Offline
Level 1
Level 1
Posts:26
Avatar

--
08-09-2012 04:26 PM
Hi,
I am trying to do the same thing and was wondering if you have a specific example to do this. Also, after we apply the offset, how do we send the same to the printer as the printing requires the map to be re drawn.

Can you have a built in feature to drag pie chart etc?
BimalUser is Offline
Level 1
Level 1
Posts:26
Avatar

--
08-09-2012 04:27 PM

Hi,
I am trying to do the same thing and was wondering if you have a specific example to do this. Also, after we apply the offset, how do we send the same to the printer as printing requires the map to be re drawn.

Can you have a built in feature to drag pie chart etc?

GaryUser is Offline
MVP
MVP
Posts:1914
Avatar

--
09-03-2012 06:37 PM
Hello Bimal,

Sorry for long time waiting, we don't have a sample for this, but if you can provide your sample to us, we can check the root cause and modify the code to make it work, what do you think?

Regards,

Gary

Need to know how to do something with Map Suite? Check our Wiki Code Samples Library and view the source code of any sample right in your web browser.

You are not authorized to post a reply.

Active Forums 4.2