here is the xaml:
<telerik:RadCartesianChart x:Name="Chart">
<telerik:RadCartesianChart.VerticalAxis>
<telerik:LinearAxis/>
</telerik:RadCartesianChart.VerticalAxis>
<telerik:RadCartesianChart.HorizontalAxis>
<telerik:CategoricalAxis/>
</telerik:RadCartesianChart.HorizontalAxis>
<telerik:RadCartesianChart.Series>
<telerik:ScatterPointSeries XValueBinding="Category" YValueBinding="Value" ItemsSource="{Binding}">
<telerik:ScatterPointSeries.PointTemplate>
<DataTemplate>
<Ellipse Width="10" Height="10" Fill="{Binding DataItem.Color}"/>
</DataTemplate>
</telerik:ScatterPointSeries.PointTemplate>
</telerik:ScatterPointSeries>
</telerik:RadCartesianChart.Series>
</telerik:RadCartesianChart>
the binding code is:
public MainWindow()
{
InitializeComponent();
DataContext = GetData(12);
} public static List<ChartData> GetData(int dataSize)
{
Random rnd = new Random();
var result = new List<ChartData>(); for (int i = 0; i <= dataSize; i++)
{
result.Add(new ChartData()
{
Category = i,
Value = rnd.Next(1, 100),
Color = new SolidColorBrush(
Color.FromArgb(255, (byte)rnd.Next(0, 256), (byte)rnd.Next(0, 256), (byte)rnd.Next(0, 256)))
});
} return result;
}
but when running app. the points is not show. pls Help.
<telerik:RadCartesianChart x:Name="Chart">
<telerik:RadCartesianChart.VerticalAxis>
<telerik:LinearAxis/>
</telerik:RadCartesianChart.VerticalAxis>
<telerik:RadCartesianChart.HorizontalAxis>
<telerik:CategoricalAxis/>
</telerik:RadCartesianChart.HorizontalAxis>
<telerik:RadCartesianChart.Series>
<telerik:ScatterPointSeries XValueBinding="Category" YValueBinding="Value" ItemsSource="{Binding}">
<telerik:ScatterPointSeries.PointTemplate>
<DataTemplate>
<Ellipse Width="10" Height="10" Fill="{Binding DataItem.Color}"/>
</DataTemplate>
</telerik:ScatterPointSeries.PointTemplate>
</telerik:ScatterPointSeries>
</telerik:RadCartesianChart.Series>
</telerik:RadCartesianChart>
the binding code is:
public MainWindow()
{
InitializeComponent();
DataContext = GetData(12);
} public static List<ChartData> GetData(int dataSize)
{
Random rnd = new Random();
var result = new List<ChartData>(); for (int i = 0; i <= dataSize; i++)
{
result.Add(new ChartData()
{
Category = i,
Value = rnd.Next(1, 100),
Color = new SolidColorBrush(
Color.FromArgb(255, (byte)rnd.Next(0, 256), (byte)rnd.Next(0, 256), (byte)rnd.Next(0, 256)))
});
} return result;
}
but when running app. the points is not show. pls Help.