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

Scatter Plots and Date Times

2 Answers 81 Views
ChartView
This is a migrated thread and some comments may be shown as answers.
Gareth McNicol
Top achievements
Rank 1
Gareth McNicol asked on 29 Feb 2012, 01:05 PM
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 Answers, 1 is accepted

Sort by
0
Gareth McNicol
Top achievements
Rank 1
answered on 29 Feb 2012, 01:23 PM
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.
0
Sia
Telerik team
answered on 05 Mar 2012, 02:52 PM
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 >>
Tags
ChartView
Asked by
Gareth McNicol
Top achievements
Rank 1
Answers by
Gareth McNicol
Top achievements
Rank 1
Sia
Telerik team
Share this question
or