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

Doubt with FastLineSeries

Hello, I would like to know if i can have a FastLineSeries dashed, but like the image bellow. Can i get the same result using just one Chart serie?

Example

Thanks.

10 Replies

RA Rachel A Syncfusion Team July 24, 2019 10:50 AM UTC

Hi Ramon, 
 
Greetings from Syncfusion. 
 
Currently there is no possibility to achieve your requirement using only one series. But we have prepared a workaround sample having two FastLineSeries and using DataSource and StrokeRegion properties. We have prepared sample and it can be downloaded from the below link. 
 
 
Please refer the below code snippet. 
 
[XAML]: 
<chart:SfChart.Series> 
    <chart:FastLineSeries x:Name="series1" Color="Blue" ItemsSource="{Binding LineSeriesData}" XBindingPath="Date" YBindingPath="Value" Label="Actual"> 
    </chart:FastLineSeries> 
    <local:FastLineSeriesExt x:Name="series2" Color="Blue" DataSource="{Binding LineSeriesData}" XBindingPath="Date" YBindingPath="Value" Label="Future"> 
    </local:FastLineSeriesExt> 
</chart:SfChart.Series> 

 
 [C#]:  
series2.StrokeRegion = new DateTime(2006, 01, 01); 
series1.StrokeDashArray = new double[] { 5, 3 }; 
 
 [C#]: 
public class FastLineSeriesExt : FastLineSeries 
{ 
    /// <summary> 
    /// Gets or sets the data source to the chart. This is a bindable property. 
    /// </summary>  
    public static readonly BindableProperty DataSourceProperty = 
        BindableProperty.Create("DataSource", typeof(IEnumerable), typeof(FastLineSeriesExt), null, BindingMode.Default, null, OnDataSourceChanged); 
 
    /// <summary> 
    /// Gets or sets the Stroke started region. This is a bindable property. 
    /// </summary>  
    public static readonly BindableProperty StrokeRegionProperty = 
        BindableProperty.Create("StrokeRegion", typeof(DateTime?), typeof(FastLineSeriesExt), null, BindingMode.Default, null,OnStrokeRegionChanged); 
     
    public IEnumerable DataSource 
    { 
        get { return (IEnumerable)GetValue(DataSourceProperty); } 
        set { SetValue(DataSourceProperty, value); } 
    } 
 
    public DateTime? StrokeRegion 
    { 
        get { return (DateTime?)GetValue(StrokeRegionProperty); } 
        set { SetValue(StrokeRegionProperty, value); } 
    } 
 
    private static void OnDataSourceChanged(BindableObject bindable, object oldValue, object newValue) 
    { 
        var fastLineSeries = bindable as FastLineSeriesExt; 
        SetItemSource(fastLineSeries); 
    } 
 
    private static void OnStrokeRegionChanged(BindableObject bindable, object oldValue, object newValue) 
    { 
        var fastLineSeries = bindable as FastLineSeriesExt; 
        SetItemSource(fastLineSeries); 
    } 
 
    private static void SetItemSource(FastLineSeriesExt fastLineSeries) 
    {  
        if (fastLineSeries == null || fastLineSeries.DataSource == null) 
            return; 
 
        var data = fastLineSeries.DataSource as ObservableCollection<Model>; 
        fastLineSeries.ItemsSource = data?.Where(a => a.Date <= fastLineSeries.StrokeRegion).ToList(); 
    } 
} 
 
Regards, 
Rachel. 



RF Ramon Farizel July 25, 2019 01:13 PM UTC

Thanks Rachel!

This sample really helped me , but i have another problem.
I'm trying use trackball with this Chart and faced an Issue on iOS. The Trackball label in axis isn't updating correctly, in the dashed line repeat the 2006 year.

I Attached some images and my code to show the problem.

*On Android works fine. 

Attachment: SampleWithTrackball_d3a54729.zip



RF Ramon Farizel July 26, 2019 02:33 PM UTC

Thanks for your attention Rachel!  


RA Rachel A Syncfusion Team July 29, 2019 05:42 AM UTC

Hi Ramon, 
 
Thanks for the update. 
 
As promised, we will include the fix in weekly NuGet which is scheduled to be rolled out on 6th August 2019. 
 
Thanks, 
Rachel. 



RA Rachel A Syncfusion Team August 6, 2019 12:20 PM UTC

Hi Ramon,

The issue with "[iOS] Trackball axis label shows incorrect data if we add more than one series with different data point count
" has been fixed and the patch for this fix can be downloaded from the following location.

Recommended approach - exe will perform automatic configuration
Please find the patch setup from below location:
 
Advanced approach – use only if you have specific needs and can directly replace existing assemblies for your build environment
Please find the patch assemblies alone from below location:
 
Nuget –  

Assembly Version: 17.2.0.34
 

To automatically run the Assembly Manager, please check the Run assembly manager checkbox option while installing the patch. If this option is unchecked, the patch will replace the assemblies in precompiled assemblies’ folder only. Then, you will have to manually copy and paste them to the preferred location or you will have to run the Syncfusion Assembly Manager application (available from the Syncfusion Dashboard, installed as a shortcut in the Application menu) to re-install assemblies.

Note :
To change how you receive bug fixes, ask your license management portal admin to change your project’s patch delivery mode.

https://www.syncfusion.com/account/license

Disclaimer :
Please note that we have created this patch for version 17.2.0.34 specifically to resolve the following issue(s) reported in this/the incident(s). 146102

If you have received other patches for the same version for other products, please apply all patches in the order received. This fix will be included in our next weekly nuget which will be available in 13th   August 2019.
 
Thanks, 
Rachel. 



RF Ramon Farizel August 13, 2019 06:41 PM UTC

Hello Rachel,

Any update about this issue?


RA Rachel A Syncfusion Team August 14, 2019 03:53 AM UTC

Hi Ramon, 
 
We have already provided patch for the reported issue in our previous update. We are sorry to let you know that we have not moved the fix in this weekly NuGet (17.2.0.41). We will move this fix in our next weekly NuGet which is scheduled to be released on 20th August 2019. We appreciate your patience until then. 
 
Thanks, 
Rachel.  



RA Rachel A Syncfusion Team August 20, 2019 08:34 AM UTC

Hi Ramon, 
 
As the Volume 2 SP1 release will be released by this week, so there is no weekly NuGet release today. So, this fix will be included in the Volume 2 SP1 release. We will update you once it is rolled out. 
 
Thanks, 
Rachel. 



MK Muneesh Kumar G Syncfusion Team August 22, 2019 10:00 AM UTC

Hi Ramon,  
 
We are glad to announce that our Essential Studio 2019 Volume 2 Service pack 1 release (v17.2.0.46) is rolled out and is available for download under the following link. 
 
 
We thank you for your support and appreciate your patience in waiting for this release. Please get in touch with us if you would require any further assistance. 
 
Thanks, 
Muneesh Kumar G. 
 


Loader.
Live Chat Icon For mobile
Up arrow icon