Hoverscope series RadContextMenu

6 posts, 2 answers
  1. Biruh MEKONNEN
    Biruh MEKONNEN avatar
    23 posts
    Member since:
    Apr 2010

    Posted 07 Feb 2011 Link to this post

    Hi,

    In fact I have some stackedbarseries, I want to add some contextmenus on each bar by setting the ItemStyle to a custom style (I did exactly like in the demo "chart and context menu"). It's working.

    However when I add the line
    seriesDefinition.InteractivitySettings.HoverScope = InteractivityScope.Series;

    The behavior in not kept for the bar. The opacity does not change. Only the opacity of the labels of the series which are not hovered is decreasing.

    So, is there a way to keep this behavior for the whole bar, or to decrease the opacity of the series which are not hovered?

    Thanks,

    regards.
  2. Answer
    Sia
    Admin
    Sia avatar
    667 posts

    Posted 09 Feb 2011 Link to this post

    Hello Biruh MEKONNEN,

    You need to use the latest template of the Stacked Bar series with visual state groups which are necessary for the interactivity functionality. Please find an example attached to my answer where you can see the hover behavior working.

    Regards,
    Sia
    the Telerik team
    Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
  3. DevCraft banner
  4. Biruh MEKONNEN
    Biruh MEKONNEN avatar
    23 posts
    Member since:
    Apr 2010

    Posted 09 Feb 2011 Link to this post

    Ok,

    sry I updated my post several times. I just messed up.
    Your solution is definitely working fine !!!!


    Thanks for everything!
  5. Biruh MEKONNEN
    Biruh MEKONNEN avatar
    23 posts
    Member since:
    Apr 2010

    Posted 14 Feb 2011 Link to this post

    Hi,

    in fact I want also to apply contextmenus with other chart types such as line and area.
    Is it possible to have the last template of these chart types?
    And more generally where can I find templates of every telerik control?
    I don't have blend for the moment...

    Thanks for everything!
  6. Answer
    Sia
    Admin
    Sia avatar
    667 posts

    Posted 17 Feb 2011 Link to this post

    Hello Biruh MEKONNEN,

    You can find the latest templates in the source code which is distributed to the licensed developers.  For your convenience here are the line and area templates:
    <Style x:Key="LineStyle"
        TargetType="telerikCharting:Line">
        <Setter Property="Template" >
            <Setter.Value>
                <ControlTemplate TargetType="telerikCharting:Line">
                    <Canvas x:Name="PART_MainContainer">
                        <Line x:Name="PART_LineGeometry"
                            Fill="Transparent"
                            Stroke="Transparent"
                            StrokeThickness="5"
                            X1="0"
                            Y1="{TemplateBinding StartPointY}"
                            X2="{TemplateBinding EndPointX}"
                            Y2="{TemplateBinding EndPointY}"
                            Style="{TemplateBinding ItemStyle}" />
                        <telerikCharting:PointMark x:Name="PART_PointMark"
                                                Canvas.Top="{TemplateBinding StartPointY}"
                                                PointMarkCanvasLeft="{TemplateBinding PointMarkCanvasLeft}"
                                                PointMarkCanvasTop="{TemplateBinding PointMarkCanvasTop}"
                                                Visibility="{TemplateBinding PointMarkVisibility}"
                                                ShapeStyle="{TemplateBinding PointMarkShapeStyle}"
                                                Style="{TemplateBinding PointMarkItemStyle}" />
                        <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:VisualStateManager.VisualStateGroups>
                    </Canvas>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    Area:
    <Style x:Key="AreaStyle"
        TargetType="telerikCharting:Area">
        <Setter Property="Template" >
            <Setter.Value>
                <ControlTemplate TargetType="telerikCharting:Area">
                    <Canvas>
                        <Rectangle x:Name="PART_AreaRectangle"
                            Height="{TemplateBinding ItemActualHeight}"
                            Width="{TemplateBinding ItemActualWidth}"
                            Fill="Transparent"/>
                            <telerikCharting:PointMark x:Name="PART_PointMark"
                                                    Canvas.Top="{TemplateBinding StartPointY}"
                                                    PointMarkCanvasLeft="{TemplateBinding PointMarkCanvasLeft}"
                                                    PointMarkCanvasTop="{TemplateBinding PointMarkCanvasTop}"
                                                    Visibility="{TemplateBinding PointMarkVisibility}"
                                                    ShapeStyle="{TemplateBinding PointMarkShapeStyle}"
                                                    Style="{TemplateBinding PointMarkItemStyle}" />
                    </Canvas>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    I hope this helps you.


    Regards,
    Sia
    the Telerik team
    Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
  7. Biruh MEKONNEN
    Biruh MEKONNEN avatar
    23 posts
    Member since:
    Apr 2010

    Posted 17 Feb 2011 Link to this post

    Perfect, thank you again !
Back to Top
DevCraft banner