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

Show zero (middle) point indicator in linear spartline

1 Answer 67 Views
Sparkline
This is a migrated thread and some comments may be shown as answers.
Muhammad Irfan
Top achievements
Rank 1
Muhammad Irfan asked on 11 Nov 2011, 11:48 AM
Hello,
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.

Thanks,
M. Irfan

1 Answer, 1 is accepted

Sort by
0
Yavor
Telerik team
answered on 16 Nov 2011, 10:46 AM
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:RadLinearSparkline.CustomIndicators>
        <telerik:CustomIndicator Index="2" Shape="Diamond" Fill="Red" />
    </telerik:RadLinearSparkline.CustomIndicators>
</telerik:RadLinearSparkline>

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:RadLinearSparkline.CustomIndicators>
        <telerik:CustomIndicator  XValue="2" YValue="14" Shape="Diamond" Fill="Red" />
    </telerik:RadLinearSparkline.CustomIndicators>
</telerik:RadLinearSparkline>

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.

Regards,
Yavor
the Telerik team

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

Tags
Sparkline
Asked by
Muhammad Irfan
Top achievements
Rank 1
Answers by
Yavor
Telerik team
Share this question
or