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

Chart : mouse over series

10 Answers 143 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Nicolas Wagener
Top achievements
Rank 1
Nicolas Wagener asked on 31 Aug 2010, 09:53 AM
Hello,

I want to have the same animation in my chart that in the Smart Labels exemples.

I mean, when my mouse is over a series I want to see just the series that I mouse over...
How do I change the opacity of the other series ?

Thank You.

Greetz
Nicolas.

10 Answers, 1 is accepted

Sort by
0
Accepted
Nikolay
Telerik team
answered on 02 Sep 2010, 08:45 AM
Hi Nicolas Wagener,

You can achieve this by enabling the chart interactivity effects, here is a sample code snippet demonstrating how to do it :
BarSeriesDefinition def = new BarSeriesDefinition();
def.InteractivitySettings.HoverScope = InteractivityScope.Item;

For more information on this feature, please, have a look at this help topic. You may also refer to our InteractivityEffects example and review the code by clicking on the View Code button.

Hope this helps.

Kind regards,
Nikolay
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
Nicolas Wagener
Top achievements
Rank 1
answered on 02 Sep 2010, 11:57 AM
Tank you :)
0
Manish Kumar
Top achievements
Rank 1
answered on 06 Dec 2010, 01:38 PM
Hi

I have a similar requirement but I need to trap the value of AxisY on mouse hover or LeftButtonClicked event.  Is this possible?
for reference i have attached image document

Thanks,
Manish
0
Nikolay
Telerik team
answered on 07 Dec 2010, 02:27 PM
Hello Manish Kumar,

Unfortunately it is not possible to show the exact Y value in a tooltip when hovering over any part of the series, the tooltips display the corresponding segment's value from the data source, but has no way of displaying the intermediate values between two individual points from the source.

For more information on tooltips, please, have a look at this help topic.

Greetings,
Nikolay
the Telerik team
Browse the videos here>> to help you get started with RadControls for Silverlight
0
Manish Kumar
Top achievements
Rank 1
answered on 08 Dec 2010, 08:00 AM
Hi

Thanks for your reply. Just one small query regarding LineSeriesDefinition. Is there any workaround so that I can disable the clicking feature when the mouse hovers on the line between the two points of a line in the chart and is available only when the mouse hovers the points.

regards
Manish Kumar
0
Nikolay
Telerik team
answered on 09 Dec 2010, 09:59 AM
Hello Manish Kumar,

You may achieve this behavior by setting the line's IsHitTestVisible property to False ( by retemplating the line ). This way you would be able to click only on the point marks.

Hope this helps.

All the best,
Nikolay
the Telerik team
Browse the videos here>> to help you get started with RadControls for Silverlight
0
Manish Kumar
Top achievements
Rank 1
answered on 09 Dec 2010, 11:15 AM
Hi

Thanks, but may i know how do we retemplate out the line. I tried doing by creating a simple style as below, will this work ? and if yes where i am doing wrong.

Style

 

pathStyle1 = new Style(typeof(System.Windows.Shapes.Path));

 

pathStyle1.Setters.Add(

new Setter(System.Windows.Shapes.Path.IsHitTestVisibleProperty, "true"));

 

 

Style lineStyle1 = new Style(typeof(Telerik.Windows.Controls.Charting.LineSeries));

 

lineStyle1.Setters.Add(

new Setter(LineSeries.BorderLineStyleProperty, pathStyle1));

 



thanks
Manish
0
Manish Kumar
Top achievements
Rank 1
answered on 09 Dec 2010, 11:47 AM
Hi
 I also created a style as below but some where i am getting javascript error

Line: 55
Error: Unhandled Error in Silverlight Application
Code: 2012   
Category: ParserError      
Message: Unknown attribute PointMarkCanvasLeft on element PointMark.    
File:     
Line: 3    
Position: 136    


may be some dll version mismatch. I am using 2010.2.714.1030. can you please correct my script.

<Style x:Key="LineStyle" TargetType="charting:Line">

 

 

 

<Setter Property="Template" > 

 

 

 

<Setter.Value> 

 

 

 

<ControlTemplate TargetType="charting:Line"> 

 

 

 

<Canvas x:Name="PART_CanvasContainer"> 

 

 

 

<Line x:Name="PART_LineGeometry" StrokeThickness="1" X1="0" 

 

 

Y1="{TemplateBinding StartPointY}" X2="{TemplateBinding EndPointX}" Y2="{TemplateBinding EndPointY}" 

 

 

Style="{TemplateBinding ItemStyle}" /> 

 

 

 

<charting: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>

regards
Manish

 

0
Manish Kumar
Top achievements
Rank 1
answered on 09 Dec 2010, 03:44 PM
Hi

I guess i have resolved the issue after removing the property from the style script namely 
 PointMarkCanvasLeft="{TemplateBinding PointMarkCanvasLeft}" PointMarkCanvasTop="{TemplateBinding PointMarkCanvasTop}" 
is that correct ?...

thanks a lot!!
Manish

0
Nikolay
Telerik team
answered on 11 Dec 2010, 10:15 AM
Hi Manish Kumar,

You can retemplate the line in the following way :
<Style x:Key="CustomStyle"
            TargetType="telerik:Line">
            <Setter Property="Template" >
                <Setter.Value>
                    <ControlTemplate TargetType="telerik:Line">
                        <Canvas x:Name="PART_MainContainer">
                            <Line x:Name="PART_LineGeometry"
                              Fill="Transparent" IsHitTestVisible="False"
                              Stroke="Transparent"
                              StrokeThickness="5"
                              X1="0"
                              Y1="{TemplateBinding StartPointY}"
                              X2="{TemplateBinding EndPointX}"
                              Y2="{TemplateBinding EndPointY}"
                              Style="{TemplateBinding ItemStyle}" />
                            <telerik: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>
 
Then add the custom style :
<telerik:RadChart x:Name="RadChart1">
            <telerik:RadChart.SeriesMappings>
                <telerik:SeriesMapping>
                    <telerik:SeriesMapping.SeriesDefinition>
                        <telerik:LineSeriesDefinition ItemStyle="{StaticResource CustomStyle}"/>
                    </telerik:SeriesMapping.SeriesDefinition>
                    <telerik:ItemMapping DataPointMember="XCategory" FieldName="FieldName1" />
                    <telerik:ItemMapping DataPointMember="YValue" FieldName="FieldName2" />
                </telerik:SeriesMapping>
            </telerik:RadChart.SeriesMappings>
        </telerik:RadChart>

Hope this helps.

Best wishes,
Nikolay
the Telerik team
Browse the videos here>> to help you get started with RadControls for Silverlight
Tags
Chart
Asked by
Nicolas Wagener
Top achievements
Rank 1
Answers by
Nikolay
Telerik team
Nicolas Wagener
Top achievements
Rank 1
Manish Kumar
Top achievements
Rank 1
Share this question
or