Hi Telerik,
I have a problem with binding data to chart
my point inculcated date and int
but my int can be null
i don't what to display the point but i what the chart to show the empty space
code:
public class DataEntity : NSObject
{
[Export("Date")]
public NSDate Date { get; set; }
[Export("Value")]
public int? Value { get; set; }
public SeriesNames SeriesName { get; set; }
}
5 Answers, 1 is accepted
0
Hello Itamar,
Can you please share some more information about the series type you are using?
Regards,
Deyan
Telerik by Progress
Can you please share some more information about the series type you are using?
Regards,
Deyan
Telerik by Progress
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
Itamar
Top achievements
Rank 1
answered on 12 Mar 2017, 04:46 PM
On the chart we build, the x axis is: TKChartNumericAxis and the y TKChartDateTimeAxis
And I am using the series TKChartLineSeries and TKChartAreaSeries
public class DataEntity : TKChartDataPoint // NSObject
{
public override NSObject DataYValue
{
[Export("dataYValue")]
get
{
return new NSNumber(this.Value);
}
}
public override NSObject DataXValue
{
[Export("dataXValue")]
get
{
return Date;
}
}
public NSDate Date { get; set; }
public double Value { get; set; }
public SeriesNames SeriesName { get; set; }
}
I need to change the double value to double nullable
And I am using the series TKChartLineSeries and TKChartAreaSeries
public class DataEntity : TKChartDataPoint // NSObject
{
public override NSObject DataYValue
{
[Export("dataYValue")]
get
{
return new NSNumber(this.Value);
}
}
public override NSObject DataXValue
{
[Export("dataXValue")]
get
{
return Date;
}
}
public NSDate Date { get; set; }
public double Value { get; set; }
public SeriesNames SeriesName { get; set; }
}
I need to change the double value to double nullable
0
Hi,
Thanks for writing back.
Currently support for EMPTY (nil) values is not implemented. Here's a similar thread on our forums that suggest a way for working around this limitation:
http://www.telerik.com/forums/dealing-with-nil-value-in-series
Let us know should you have additional questions.
Regards,
Deyan
Telerik by Progress
Thanks for writing back.
Currently support for EMPTY (nil) values is not implemented. Here's a similar thread on our forums that suggest a way for working around this limitation:
http://www.telerik.com/forums/dealing-with-nil-value-in-series
Let us know should you have additional questions.
Regards,
Deyan
Telerik by Progress
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
Itamar
Top achievements
Rank 1
answered on 16 Mar 2017, 10:17 AM
I look on the code sample that you
send me
and be my understanding I need to create new series when every I have null point
I have a lot of null point in my charts and I don’t think It is a good solution
And also we working with databinding
But if it is the only solution then you can send me code example in xamarin iOS
Regards Itamar
and be my understanding I need to create new series when every I have null point
I have a lot of null point in my charts and I don’t think It is a good solution
And also we working with databinding
But if it is the only solution then you can send me code example in xamarin iOS
Regards Itamar
0
Hi Itamar,
Thanks for writing back.
Here's a sample snippet which works good on my side:
Regards,
Deyan
Telerik by Progress
Thanks for writing back.
Here's a sample snippet which works good on my side:
public void ReloadChart()
{
chart.RemoveAllData ();
Random r = new Random ();
for (int i = 0; i <
1
; i++) {
List<TKChartDataPoint> list = new List<
TKChartDataPoint
> ();
for (int j = 0; j <
80
; j++) {
list.Add(new TKChartDataPoint(new NSNumber(j+1), j % 7 == 0 ? null : new NSNumber(r.Next()%100)));
}
chart.BeginUpdates();
List<TKChartDataPoint> newSource = new List<
TKChartDataPoint
>();
for (int k = 0; k <
list.Count
; k++)
{
TKChartDataPoint
dp
=
list
[k];
if (dp.DataYValue == null)
{
TKChartLineSeries
newSeries
= new TKChartLineSeries(newSource.ToArray());
chart.AddSeries(newSeries);
newSource
= new List<TKChartDataPoint>();
}
else
{
newSource.Add(dp);
}
if (i == list.Count - 1 && newSource.Count > 0)
{
TKChartLineSeries lineSeries = new TKChartLineSeries();
chart.AddSeries(lineSeries);
}
}
chart.EndUpdates();
}
Regards,
Deyan
Telerik by Progress
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