Scatter Plots and Date Times

3 posts, 0 answers
  1. Gareth McNicol
    Gareth McNicol avatar
    22 posts
    Member since:
    Nov 2006

    Posted 29 Feb 2012 Link to this post

    When I have a scatter point series where xvalue mapping is a date time and the chart's horizontal axis is a DateTimeContinuousAxis I get nothing plotted.

    I can't imagine I'm the only one wanting to plot time series data without using the line series?

    Is there a way to use the line series but not draw the lines, but draw the points?  
  2. Gareth McNicol
    Gareth McNicol avatar
    22 posts
    Member since:
    Nov 2006

    Posted 29 Feb 2012 Link to this post

    Setting the point template and setting the stroke thickness gets me halfway there but the fill of the ellipse is wrong...

    <telerik:LineSeries CategoryBinding="X" ValueBinding="Y" StrokeThickness="0" ItemsSource="{Binding Data}">
        <telerik:LineSeries.PointTemplate>
            <DataTemplate>
                <Ellipse Height="3" Width="3" Fill="{Binding Stroke, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type telerik:LineSeries}}, BindsDirectlyToSource=True, UpdateSourceTrigger=PropertyChanged}" />
            </DataTemplate>
        </telerik:LineSeries.PointTemplate>
    </telerik:LineSeries>

    How would one bind it to the palette  which is metro.
  3. UI for WPF is Visual Studio 2017 Ready
  4. Sia
    Admin
    Sia avatar
    667 posts

    Posted 05 Mar 2012 Link to this post

    Hello Gareth,

    If you need the accent color from our metro theme, you need to use the following DataTemplate:
    <telerik:MetroColors x:Key="MetroColors" />
    <SolidColorBrush x:Key="AccentBrush" Color="{Binding Source={StaticResource MetroColors}, Path=Palette.AccentColor}"/>
    <DataTemplate x:Key="pointTemplate">
        <Grid>
            <Ellipse Fill="{StaticResource AccentBrush}" Height="15" Width="15"/>
        </Grid>
    </DataTemplate>

    But if you have set the Metro palette to your RadChartView then use:
    <DataTemplate x:Key="pointTemplate2">
        <Grid>
            <Ellipse Fill="{Binding ElementName=chart, Path=Palette.GlobalEntries[1].Fill}" Height="15" Width="15"/>
        </Grid>
    </DataTemplate>
    where chart is the x:Name.

    I hope this helps.

    Regards,
    Sia
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Back to Top