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

Line chart with symbols?

1 Answer 5 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Brian
Top achievements
Rank 1
Brian asked on 18 Nov 2011, 10:04 PM
Is it possible to produce a line chart that has symbols for various points on the chart?  See the attached image for an example of what I'm referring to.
I'd like to create a line chart that has a symbol every nth point.  For example, the attached image is a line chart that has a symbol every 10th point.
Tks.

1 Answer, 1 is accepted

Sort by
0
Sia
Telerik team
answered on 23 Nov 2011, 01:22 PM
Hi Brian,

You can use a similar approach as the shown in this example. The main idea is to bind the visibility in the point marks' template to a property in your view model.

Here is the default point mark's template:
<Style  x:Key="CustomPoint" TargetType="telerikCharting:PointMark">
    <Setter Property="Size" Value="10" />
    <Setter Property="Template">
        <Setter.Value>
            <ControlTemplate TargetType="telerikCharting:PointMark">
                <Canvas>
                    <Path x:Name="PART_PointMarkPath"
                        Canvas.Left="{TemplateBinding PointMarkCanvasLeft}"
                        Canvas.Top="{TemplateBinding PointMarkCanvasTop}"
                        Style="{TemplateBinding ShapeStyle}"
                        Width="{TemplateBinding Size}"
                        Height="{TemplateBinding Size}"
                        Stretch="Uniform">
                        <Path.Data>
                            <PathGeometry x:Name="PART_PointMarkPathGeometry" />
                        </Path.Data>
                    </Path>
                </Canvas>
            </ControlTemplate>
        </Setter.Value>
    </Setter>
</Style>

and this style can be set through the exposed PointMarkItemStyle property of the Line series definition.

Regards,
Sia
the Telerik team

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

Tags
Chart
Asked by
Brian
Top achievements
Rank 1
Answers by
Sia
Telerik team
Share this question
or