Display Scale Bar

5 posts, 0 answers
  1. Alexander
    Alexander avatar
    77 posts
    Member since:
    Apr 2013

    Posted 13 Apr 2015 Link to this post

    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

  2. Petar Marchev
    Admin
    Petar Marchev avatar
    968 posts

    Posted 16 Apr 2015 Link to this post

    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.

     
  3. UI for WPF is Visual Studio 2017 Ready
  4. Alexander
    Alexander avatar
    77 posts
    Member since:
    Apr 2013

    Posted 16 Apr 2015 in reply to Petar Marchev Link to this post

    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

  5. Petar Marchev
    Admin
    Petar Marchev avatar
    968 posts

    Posted 17 Apr 2015 Link to this post

    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.

     
  6. Alexander
    Alexander avatar
    77 posts
    Member since:
    Apr 2013

    Posted 17 Apr 2015 in reply to Petar Marchev Link to this post

    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...

Back to Top
UI for WPF is Visual Studio 2017 Ready