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

Hoverscope series RadContextMenu

5 Answers 75 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Biruh MEKONNEN
Top achievements
Rank 1
Biruh MEKONNEN asked on 07 Feb 2011, 01:04 PM
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.

5 Answers, 1 is accepted

Sort by
0
Accepted
Sia
Telerik team
answered on 09 Feb 2011, 10:27 AM
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>>
0
Biruh MEKONNEN
Top achievements
Rank 1
answered on 09 Feb 2011, 11:35 AM
Ok,

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


Thanks for everything!
0
Biruh MEKONNEN
Top achievements
Rank 1
answered on 14 Feb 2011, 11:54 AM
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!
0
Accepted
Sia
Telerik team
answered on 17 Feb 2011, 09:57 AM
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>>
0
Biruh MEKONNEN
Top achievements
Rank 1
answered on 17 Feb 2011, 06:08 PM
Perfect, thank you again !
Tags
Chart
Asked by
Biruh MEKONNEN
Top achievements
Rank 1
Answers by
Sia
Telerik team
Biruh MEKONNEN
Top achievements
Rank 1
Share this question
or