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

why points donot display

1 Answer 55 Views
ChartView
This is a migrated thread and some comments may be shown as answers.
Wpf
Top achievements
Rank 1
Wpf asked on 24 Dec 2014, 09:19 AM
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.
     

1 Answer, 1 is accepted

Sort by
0
Petar Marchev
Telerik team
answered on 25 Dec 2014, 04:48 PM
Hi,

As explained here the scatter series require two numeric axes. So you need to either use a LineSeries instead of the scatter line series or you need to use a numeric (LinearAxis or LogarithmicAxis) instead of the CategoricalAxis.

Here are some valuable links:
online qsf examples
sdk samples

Regards,
Petar Marchev
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
ChartView
Asked by
Wpf
Top achievements
Rank 1
Answers by
Petar Marchev
Telerik team
Share this question
or