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

Highlighting an item on a chart

1 Answer 48 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Sunandini
Top achievements
Rank 1
Sunandini asked on 10 May 2009, 07:46 PM
I have a WPF application with a Line chart.

I have a bunch of things that I cannot figure out how to do...
(1) When I user selects a particular value (in another control), which can be used to identify a particular data point in my chart, I want to be able to "highlight" that point on my chart. Is it possible to do that?
(2) Is it possible to make the circle which represents each data item bigger?
(3) When I add more data to the dataseries, the distance between two points on the X Axis keeps shrinking. Is it possible to keep that distance constant and scroll horizontally instead?

Any help with this is greatly appreciated.

Thanks,
-Sunandini


1 Answer, 1 is accepted

Sort by
0
Giuseppe
Telerik team
answered on 13 May 2009, 01:31 PM
Hi Sunandini,

Onto your questions:

  • This functionality is not supported by the control. We will forward your inquiry to our devteam for further consideration.
  • We assume you are talking about the point mark visual element present in series like Line, Spline, Area, etc. You can achieve the desired functionality by specifying a custom style for the point mark like this via the SeriesDefinition.PointMarkItemStyle property:

XAML
<Window x:Class="WpfApplication3.Window1" 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:control="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Charting" 
    xmlns:chart="clr-namespace:Telerik.Windows.Controls.Charting;assembly=Telerik.Windows.Controls.Charting" 
    Title="Window1"
    <Grid x:Name="GridLayout" Background="DarkGray"
        <Grid.Resources> 
            <Style x:Key="CustomStyle" TargetType="chart:PointMark"
                <Setter Property="Size" Value="15" /> 
            </Style> 
        </Grid.Resources> 
         
        <control:RadChart x:Name="RadChart1" /> 
 
    </Grid> 
</Window> 
 

C#
DataSeries series = new DataSeries(); 
series.Definition = new LineSeriesDefinition(); 
series.Definition.PointMarkItemStyle = GridLayout.Resources["CustomStyle"as Style; 
 
series.Add(new DataPoint(40)); 
series.Add(new DataPoint(21)); 
series.Add(new DataPoint(30)); 
series.Add(new DataPoint(41)); 
series.Add(new DataPoint(60)); 
series.Add(new DataPoint(21)); 
 
RadChart1.DefaultView.ChartArea.DataSeries.Add(series); 

  • Unfortunately the current version of the control does not provide scrolling support. We have logged this in our TODO list and we will try to implement it for one of the future releases later this year.


Kind regards,
Manuel
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Chart
Asked by
Sunandini
Top achievements
Rank 1
Answers by
Giuseppe
Telerik team
Share this question
or