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

RadPolarChart: Label for PolarAxisGridLineAnnotation

5 Answers 68 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Alexander
Top achievements
Rank 1
Alexander asked on 18 May 2015, 08:47 AM

Hello,

I'm missing a way to display a label for a GridLineAnnotation in a polar chart. What is the intended way to achieve this?
I would have created my own annotation type, but the necessary methods are all internal, so overriding is not possible.
Is there a reason why these are not declared as protected internal? (This would be helpful anyway, as I also also need
other annotation types which are not possible at the moment...)

Alex

5 Answers, 1 is accepted

Sort by
0
Anna
Telerik team
answered on 20 May 2015, 10:26 AM
Hi,

You are correct that the grid line annotation of the polar char does not have a label property. The easiest way to achieve this would be to add a custom polar annotation to contain your label. I am attaching a project which demonstrates the approach.

I am not a sure which are the internal methods you are referring to, however usually the reason behind the internal status of part of the API is that it is quite easy to achieve undesirable results by using it. This is probably the case here as well. If you'd like to, you can let us know what are the other types of annotations which present difficulties for you and we can try to find a suitable solution.

Please, let me know if you have any further questions.

Regards,
Anna
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Alexander
Top achievements
Rank 1
answered on 21 May 2015, 07:04 AM

Thanks for your answer.
Although your solution may be suitable in simple scenarios, I fear it does not scale well in my case.

All your examples somehow aim at static data - in my case I have to bind the lines and labels to an enumeration. The number of items in this enumeration may change at any time - so I cannot define them in xaml code. I have to dynamically generate them at runtime. As I am displaying live values (updating with every UI rendering), I have some tight performance requirements.

At the moment, I update the limits before the chart is redrawn. To get a reasonable performance, I am reusing existing annotation instances. This is relatively simple as there is only a single type of annotation (at the moment). But if I have to use different types of annotations, this will get ugly...

Why can't there be a combined annotation having line and label? (Indeed, it would be best if all annotations could be drawn into a single canvas, not having a new object for every annotation...)

Alex

0
Anna
Telerik team
answered on 22 May 2015, 11:38 AM
Hi Alex,

A label for the polar annotation would present some design difficulties, for example how the label should be positioned, so that it is perfectly clear that it pertains to the annotation. For this reason at this point we have opted not to include it in the implementation. If you would like to, you can suggest it in our Feedback and Ideas Portal.  

I believe that at this point adding a PolarCustomAnnotation is the easiest approach in your scenario and most likely it is also best performance-wise, compared to a potential implementation of a combined annotation.

Regards,
Anna
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Alexander
Top achievements
Rank 1
answered on 26 May 2015, 07:08 AM

I understand your concerns regarding the label position. However - in this case you could have simply make the default value for displaying false - instead of not implementing it in the first place. I think the implementation would be not so much differ from the one in the cartesian chart. Please let the user decide what he want's to display.

However, I still don't really see how having at least one Canvas, one ContentPresenter and one TextBlock/Ellipse per annotation could be anyhow faster than simply drawing an ellipse and some text directly into the chart (e.g. by overriding OnRender). Therefore, I think having a real user-defined (manually drawn) annotation would be the better option in my case.

Regards,
Alex

0
Martin Ivanov
Telerik team
answered on 28 May 2015, 11:54 AM
Hi Alex,

Currently, the polar chart's PolarAxisGridLineAnnotation does not support labels as Anna described in the last posts. If you believe this is a good-to-have feature for this annotation type you can post a new feature request in our feedback portal and we will consider and define its priority in our next release planning.

About the custom grid line annotation, its performance will depend also on the custom code. However, I prepare a small example with such custom annotation. If you decide to implement your own annotation I hope my project could be a good starting point for you. Also, keep in mind that this implementation is not well tested and I cannot guarantee that it will work as expected in all cases. This is why I recommend you to use it only as a reference for your custom logic.

If you have any further questions or concerns please do not hesitate to contact us again.

Regards,
Martin
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Chart
Asked by
Alexander
Top achievements
Rank 1
Answers by
Anna
Telerik team
Alexander
Top achievements
Rank 1
Martin Ivanov
Telerik team
Share this question
or