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

Stick template

3 Answers 61 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Anatoly Chekh
Top achievements
Rank 1
Anatoly Chekh asked on 18 May 2011, 05:45 PM
Hello!

Can you give me full temlate for the stick?

Thanks, Anatoly Chekh.

3 Answers, 1 is accepted

Sort by
0
Giuseppe
Telerik team
answered on 20 May 2011, 03:17 PM
Hello Anatoly,

Here is the XAML snippet with the Stick style:
xmlns:system="clr-namespace:System;assembly=mscorlib"
xmlns:vsm="clr-namespace:System.Windows;assembly=System.Windows"
 
<Style x:Key="CustomStyle" TargetType="telerik:Stick">
    <Setter Property="Template" >
        <Setter.Value>
            <ControlTemplate TargetType="telerik:Stick">
                <Canvas x:Name="PART_MainContainer">
                    <telerik:ParametricLine x:Name="PART_VerticalLine" LineStyle="{TemplateBinding ItemStyle}"
                    <telerik:ParametricLine x:Name="PART_OpenLine" LineStyle="{TemplateBinding ItemStyle}"
                    <telerik:ParametricLine x:Name="PART_CloseLine" LineStyle="{TemplateBinding ItemStyle}"
 
                    <vsm:VisualStateManager.VisualStateGroups>
                        <vsm:VisualStateGroup x:Name="HoverStates">
                            <vsm:VisualState x:Name="Normal">
                                <Storyboard>
                                  <DoubleAnimation To="1.0" Storyboard.TargetName="PART_MainContainer" Storyboard.TargetProperty="Opacity" Duration="0.00:00:00.15" />
                                </Storyboard>
                            </vsm:VisualState>
                            <vsm:VisualState x:Name="Hovered">
                                <Storyboard>
                                  <DoubleAnimation To="1.0" Storyboard.TargetName="PART_MainContainer" Storyboard.TargetProperty="Opacity" Duration="0.00:00:00.15" />
                                </Storyboard>
                            </vsm:VisualState>
                            <vsm:VisualState x:Name="Hidden">
                                <Storyboard>
                                  <DoubleAnimation To="0.15" Storyboard.TargetName="PART_MainContainer" Storyboard.TargetProperty="Opacity" Duration="0.00:00:00.15" />
                                </Storyboard>
                            </vsm:VisualState>
                        </vsm:VisualStateGroup>
                        <vsm:VisualStateGroup x:Name="SelectionStates">
                            <vsm:VisualState x:Name="Unselected">
                            </vsm:VisualState>
                            <vsm:VisualState x:Name="Selected">
                                <Storyboard>
                                  <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_VerticalLine" Duration="0.00:00:00.05" Storyboard.TargetProperty="StrokeThickness">
                                    <DiscreteObjectKeyFrame KeyTime="0.00:00:00.0">
                                      <DiscreteObjectKeyFrame.Value>
                                        <system:Double>3</system:Double>
                                      </DiscreteObjectKeyFrame.Value>
                                    </DiscreteObjectKeyFrame>
                                  </ObjectAnimationUsingKeyFrames>
                                  <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_OpenLine" Duration="0.00:00:00.05" Storyboard.TargetProperty="StrokeThickness">
                                    <DiscreteObjectKeyFrame KeyTime="0.00:00:00.0">
                                      <DiscreteObjectKeyFrame.Value>
                                        <system:Double>3</system:Double>
                                      </DiscreteObjectKeyFrame.Value>
                                    </DiscreteObjectKeyFrame>
                                  </ObjectAnimationUsingKeyFrames>
                                  <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_CloseLine" Duration="0.00:00:00.05" Storyboard.TargetProperty="StrokeThickness">
                                    <DiscreteObjectKeyFrame KeyTime="0.00:00:00.0">
                                      <DiscreteObjectKeyFrame.Value>
                                        <system:Double>3</system:Double>
                                      </DiscreteObjectKeyFrame.Value>
                                    </DiscreteObjectKeyFrame>
                                  </ObjectAnimationUsingKeyFrames>
                                </Storyboard>
                            </vsm:VisualState>
                        </vsm:VisualStateGroup>
                    </vsm:VisualStateManager.VisualStateGroups>
                </Canvas>
            </ControlTemplate>
        </Setter.Value>
    </Setter>
</Style>


Kind regards,
Giuseppe
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Anatoly Chekh
Top achievements
Rank 1
answered on 20 May 2011, 10:18 PM
How can I change this template for paint open and close line full (from 0 to Width, not to Width / 2)?
0
Giuseppe
Telerik team
answered on 26 May 2011, 08:38 AM
Hi Anatoly Chekh,

If we understand you correctly, you can achieve the desired appearance without retemplating just by setting the RadChart.DefaultView.ChartArea.ItemWidthPercent property to 100.

Alternatively, you can check this blog post here that demonstrates how you can create custom chart series as well.

Hope this helps.


Best wishes,
Giuseppe
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Chart
Asked by
Anatoly Chekh
Top achievements
Rank 1
Answers by
Giuseppe
Telerik team
Anatoly Chekh
Top achievements
Rank 1
Share this question
or