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

Point with Categorical and Numerical Values

3 Answers 14 Views
This is a migrated thread and some comments may be shown as answers.
Ingrid
Top achievements
Rank 1
Ingrid asked on 15 Oct 2018, 03:30 AM

Hello,

1. Can anyone tell me how could I get to make Points on my chart for every data point with Numerical as Y-Value and Categorical as X-Value?

I tried to make it with ScatterPointSeries. It worked on iOS, but crash on android. Because originally ScatterPointSeries uses numerical for both X & Y Values (Code below)

 

2. And , kindly check my RadLegend on my code as well, it does not show.

Thank you.

var hAxis = new CategoricalAxis();
hAxis.LabelFontSize = 6;
 
var vAxis = new NumericalAxis();
vAxis.LabelFontSize = 7;
vAxis.LabelFormat = "#,#.#";
 
chart = new RadCartesianChart
{
         HorizontalAxis = hAxis,
         VerticalAxis = vAxis,
         VerticalOptions = LayoutOptions.FillAndExpand,
         HorizontalOptions = LayoutOptions.FillAndExpand
};
 
 
ScatterPointSeries point = new ScatterPointSeries();
point.SetBinding(ChartSeries.ItemsSourceProperty, new Binding(itemSource));
point.YValueBinding = new PropertyNameDataPointBinding(valueBinding);
point.XValueBinding = new PropertyNameDataPointBinding(categoryBinding);
point.ShowLabels = true;
point.LabelBinding = new PropertyNameDataPointBinding(labelBinding);
chart.Series.Add(point);
 
 
var legend = new RadLegend
{
        LegendProvider = chart,
        HeightRequest = 100,
        LegendItemFontColor = Color.DarkGreen,
        Orientation = LegendOrientation.Horizontal,
};
 
stacklayoutView.Children.Add(chart); //usual stacklayout on absolute layout

 

3 Answers, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 18 Oct 2018, 08:35 AM
Hello Ingrid,

1. The ScatterPointSeries require both axes of the chart to be of type NumericalAxis, so I am afraid it  will not be possible to use it in the concrete case. You would need to choose among the other series that support CategoricalAxis.

2. The provided code seems correct, so I cannot tell what could be the reason for RadLegend not to be shown.  Is it possible to send us a runnable sample project where the issue could be reproduced? You will need to open a support ticket and attach it there.

Regards,
Yana
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Ingrid
Top achievements
Rank 1
answered on 18 Oct 2018, 08:45 AM

Hi Yana,

So, is there any Series supports CategoricalAxis that can produce "point" on Chart?

Thanks !

0
Yana
Telerik team
answered on 18 Oct 2018, 11:06 AM
Hello Ingrid,

I am sorry for missing that - currently we do not provide such kind of series, however, we have it logged as a feature request in our Ideas&Feedback Portal, you could cast your vote and subscribe on status changes at the link below:
https://feedback.telerik.com/Project/168/Feedback/Details/228848-cartesianchart-introduce-pointseries

We're keeping an eye on this item and will plan it if there is demand.

Regards,
Yana
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Chart
Asked by
Ingrid
Top achievements
Rank 1
Answers by
Yana
Telerik team
Ingrid
Top achievements
Rank 1
Share this question
or