We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Additional Data in Lightswitch Silverlight SfChart

Hi,
i want to add additional series in an existing SfChart in a Lightswitch Silverlight Client. I tried the following but it seems that there is an error.
Your help would be appreciated!

Regards,
Alex

partial void CurveSetListDetail_Created()
{
    var gdpChart = this.FindControl("CurveItemCollection1");
    gdpChart.ControlAvailable += gdpChart_ControlAvailable;
}
 
 
public class CurveItem
{
    public double Week { getset; }
    public double Low { getset; }
    public double High { getset; }
}
 
void gdpChart_ControlAvailable(object sender, ControlAvailableEventArgs e)
{
    var sfChart = (Syncfusion.UI.Xaml.Charts.SfChart)e.Control;
    if (sfChart != null && sfChart.Series != null)
    {
        RangeAreaSeries series1 = new RangeAreaSeries();
      
        var Curve = new ObservableCollection<CurveItem> {
            new CurveItem() { Week = 1, Low = 5, High = 10 },
            new CurveItem() { Week = 2, Low = 6, High = 11 },
            new CurveItem() { Week = 3, Low = 7, High = 12 },
            new CurveItem() { Week = 4, Low = 8, High = 13 },
            new CurveItem() { Week = 5, Low = 9, High = 14 },
            new CurveItem() { Week = 6, Low = 10, High = 15 },
            new CurveItem() { Week = 10, Low = 15, High = 20 }
        };
        
        series1.ItemsSource = Curve;
        series1.ShowTooltip = true;
        series1.Label = "Soll";
 
        sfChart.Series.Add(series1);
    }
}

1 Reply

SA Santhiya Arulsamy Syncfusion Team February 29, 2016 12:09 PM UTC

Hi Alexander,

Thanks for contacting Syncfusion Support.

In your code sample, need to mention the property names which represents the axes values. Please find the following code sample for your reference.

[C#]

series.ItemsSource = Curve;

//Gets or sets a string that represents the X values of a series.

series.XBindingPath = "Week";

//Gets or sets the string that describes high value in Y-axis.

series.High = "High";

//Gets or sets the string that describes low value in Y-axis.

series.Low = "Low";

 


 Thanks,

 Santhiya A


Loader.
Live Chat Icon For mobile
Up arrow icon