Show zero (middle) point indicator in linear spartline

2 posts, 0 answers
  1. Muhammad Irfan
    Muhammad Irfan avatar
    18 posts
    Member since:
    Jan 2010

    Posted 11 Nov 2011 Link to this post

    I am creating a linear spark line in my wpf project. My datasource will have 43 points (from -21 to 21). I will have to mark the highest indicator point and lowest indicator point in Red whereas zero (middle) indicator point in blue.
    I can mark Highest & Lowest indicator points by using following properly

    ShowLowPointIndicators="True" ShowHighPointIndicators="True"

    However I could not find any way to highlight middle (zero) indicator point. I will appreciate for any idea to mark this point.

    M. Irfan
  2. Yavor
    Yavor avatar
    401 posts

    Posted 16 Nov 2011 Link to this post

    Hello Muhammad Irfan,

    Currently RadSparklines support 6 different kinds of indicators, but unfortunately the zero indicator is not supported. We are planning to include custom indicators and currently we are researching what API will be most useful to our customers.

    One way of implementing this feature can be to expose a collection that will hold these custom indicators. To add a custom indicator you will have to add an object saying that the 3rd point is an important one and has to be displayed as a red diamond. Sample API:

    <telerik:RadLinearSparkline ...>
            <telerik:CustomIndicator Index="2" Shape="Diamond" Fill="Red" />

    Another option can be to specify a value with X and Y intersect. This approach is more verbose and there is a real danger that you can specify a point that doesn't exist in the ItemsSource.
    <telerik:RadLinearSparkline ...>
            <telerik:CustomIndicator  XValue="2" YValue="14" Shape="Diamond" Fill="Red" />

    A third option can be to create a new class, inherit from a base class (for example SparklineCustomIndicator) and override a method in which you can set a point as an Indicator. This approach is used in the framework for StyleSelector and TemplateSelectors.

    Your feedback is very important for us! This feature is logged in our PITS system here, so vote for it and tell us what API will be most useful for you.

    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Back to Top