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

Display Scale Bar

4 Answers 129 Views
ChartView
This is a migrated thread and some comments may be shown as answers.
Alexander
Top achievements
Rank 1
Alexander asked on 13 Apr 2015, 02:44 PM

Hi!

I want to display a scale bar (see attached image) in the chart. How can I achieve this?
I don't see an annotation type where I can specify the position in absolute values, but the size in units of the MajorStep.

I need it in both Cartesian and Polar charts.

 

A second question: How can I display a label for a PolarAxisGridLineAnnotation?

Alex

4 Answers, 1 is accepted

Sort by
0
Petar Marchev
Telerik team
answered on 16 Apr 2015, 08:16 AM
Hello Alexander,

1. We are unsure what the exact requirement is here. The chart is a data visualization control and it works with values. These values are the origin of positioning of the elements, because the values are based on the data, and all items in the chart are data-related. Perhaps if you need to show something that is not data-related, you can place it outside the chart, where you can use absolute positioning.

If you think that I did not address the issue properly, please give us more information on the matter, it would be great if you could send a drawing of how you want the chart to look like.

2. The polar axis grid line annotation does not have built-in support for labels. You can use a PolarCustomAnnotation in order to display a label at the required position.

Regards,
Petar Marchev
Telerik
 

See What's Next in App Development. Register for TelerikNEXT.

 
0
Alexander
Top achievements
Rank 1
answered on 16 Apr 2015, 08:39 AM

Thanks for your answer.

In principle it does not matter if it's inside or outside the chart. It is not data related but related to the (visible) scale of the chart.
I don't want to display the labels on the axis (as these could be e.g. 68.1324 mm, 68.1325 mm, 68.1326 mm, 68.1327 mm which would be difficult to read). Instead I want to display the only the difference between two main ticks. (in this case 0.0001 mm or 0.1µm, depending on some setting - the absolute values do not matter in my case). So I have to somehow know the Value -> Screen position conversion of the chart (and have to detect if the scale of the chart changes)

Alex

0
Petar Marchev
Telerik team
answered on 17 Apr 2015, 07:23 AM
Hi Alexander,

It is still unclear to us what exactly you are trying to achieve.

You mention main ticks (which assumes there are minor ticks as well). In the new ChartView (which is a set of controls - RadCartesianChart, RadPieChart, RadPolarChart) there are no minor ticks. Are you perhaps using the old RadChart?

The RadCartesianChart has a conversion api which calculates the position based on data, and data based on position. From what I understand this is what you are looking for. The linear axis exposes an ActualRangeChange event, which you mentioned.

If you need further assistance, I will ask that you send us snapshots (drawings) of the desired output and some more explanations, because we do not understand the scenario very well. Thank you for understanding.

Regards,
Petar Marchev
Telerik
 

See What's Next in App Development. Register for TelerikNEXT.

 
0
Alexander
Top achievements
Rank 1
answered on 17 Apr 2015, 09:25 AM

No, I'm using the new chart library.

The graph should look similar to the attached image.
The position of the scale bars are fixed (not related to the data), but the height and width always have to match the (major) tick distance. It doesn't matter if there are minor ticks or not.

I think the conversion api would help, I think I found it (ConvertDataToPoint and ConvertPointToData). I was searching on the axis...

Tags
ChartView
Asked by
Alexander
Top achievements
Rank 1
Answers by
Petar Marchev
Telerik team
Alexander
Top achievements
Rank 1
Share this question
or