This is a migrated thread and some comments may be shown as answers.

Scaling Coordinates for positioning of items on Rad Diagram

3 Answers 177 Views
Diagram
This is a migrated thread and some comments may be shown as answers.
Gary
Top achievements
Rank 1
Gary asked on 16 Sep 2013, 01:07 PM
I have the the following requirements, that I'm unsure as to how to implement with the Rad Diagram control:

Our business objects all have geographical coordinates associated with them.  The objects should be displayed as items on a diagram with the diagram positioning being representative of their geographical coordinates (Note The coordinate system in use is Northing / Easting). These coordinates should be two-way (i.e. the user should be able to drag the object to a new position and this should reflected in our object model).

Thus far I'm having difficulty understanding the following:

1) How to apply a 2 way scaling between the RadDiagram node's Point position and the business objects geographical Coordinates.  The scaling should take into consideration the available space in the RadDiagram and the series of coordinates being plotted.
2) Have the business object's geographical coordinates display in the InformationAdorner i.e. whenever the object is being dragged the adorner should display the coordinates and not the X & Y of the Point.
3) How to flip the Y axis of the diagram (perhaps this is to be done in the scaling?)

I've looked thru' all the examples on the RadDiagram, but none seem appropriate for the above requirements.  Any tips would be appreciated?

Gary.

3 Answers, 1 is accepted

Sort by
0
Pavel R. Pavlov
Telerik team
answered on 19 Sep 2013, 12:19 PM
Hi Gary,

With the current implementation of our RadDiagram control there is no built-in mechanism which allows users to change the beginning (start) of the coordinate system of the control.
However, you can try achieving your requirement by applying a ScaleTransform to the control. Please have in mind that all of the text fields in the domain of the control will be flipped, also. Hence, you will need to apply a transformation to all of the elements/fields that you need to visualize as usual.

When working with the RadDiagram control you need to keep in mind that we do not expose mechanism for handling the coordinate system that you require.
However, you can implement custom logic in your ViewModel which will convert your custom coordinates into the coordinates that are supported by the RadDiagram out of the box.

Furthermore, when you calculate the position of your custom shapes you can bind the RadDiagramShape.Position property to a property of type Point in your ViewModel. By doing so you will preserve the position of each shape in your ViewModel.

Regarding the customization of the ItemInformationAdorner, you can extract the default template and customize the ContentTemplate of the ContentPresenter called "InformationTipPresenter". You will be able to bind the Text properties of the TextBlocks to your custom properties defined in your ViewModel.

I would summarize that in order to achieve your requirements you need to:
  • Implement customizations that are involved with the default template of our controls
  • Implement custom converter between the coordinate system of the RadDiagram and your custom coordinate system
I can see that your trial has already expired and I would offer you my help on extending it. However, our management now requires us to submit paper work before granting trial extensions. If you can answer the following questions, I will file the paper work so we can get started!
  1. How long do you need the extension for?
  2. When are you hoping to decide on purchase a product?
  3. If RadControls for WPF suites your needs, how may licenses would you/your company be interested in purchasing?

I am looking forward to hearing from you.

Regards,
Pavel R. Pavlov
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
David Walker
Top achievements
Rank 1
answered on 19 Sep 2013, 12:38 PM
Hi Pavel,

Thank you for offering to extend the trial of the controls, however my company is already fully paid up (I can't remember why I downloaded a trial version).

My colleague has submitted a support ticket for this (ticket #738334) so that we were able to attach a proof-of-concept application to better demonstrate our requirements.

In that you will see we have applied a ScaleTransform.ScaleY = -1 to the RadDiagram to effectively flip the y-coordinates.  This has led to some 'frustrations' as to us having to reverse-flip everything else

The support ticket has some more questions regarding the technicalities of achieving our use-case, so I would appreciate it if you could look at the support ticket.

Regards,
Gary.
0
Pavel R. Pavlov
Telerik team
answered on 19 Sep 2013, 12:44 PM
Hi David,

Thank you for pointing out this fact. We will take a look at your support ticket and we will answer it within its response-time.

Regards,
Pavel R. Pavlov
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Tags
Diagram
Asked by
Gary
Top achievements
Rank 1
Answers by
Pavel R. Pavlov
Telerik team
David Walker
Top achievements
Rank 1
Share this question
or