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.
Unfortunately, activation email could not send to your email. Please try again.

Change Chart type at runtime

Thread ID:

Created:

Updated:

Platform:

Replies:

124209 May 24,2016 03:16 PM May 27,2016 05:02 AM Xamarin.Forms 3
loading
Tags: SfChart
Atif
Asked On May 24, 2016 03:16 PM

Hi i have successfully using chart what i am facing challenge is to change to chart type at run time my code is given below please guide me what i have to do to change chart type.
<chart:SfChart BackgroundColor="White" Grid.Row="1" x:Name="Chart" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand">
<chart:SfChart.ChartBehaviors>
<chart:ChartZoomPanBehavior EnablePanning="true" EnableZooming="false" />
<chart:ChartTrackballBehavior ShowLabel="True" ShowLine="True" />
</chart:SfChart.ChartBehaviors>
<chart:SfChart.PrimaryAxis>
<chart:CategoryAxis LabelPlacement="BetweenTicks">
<chart:CategoryAxis.LabelStyle>
<chart:ChartAxisLabelStyle TextColor="#0B4940">
<chart:ChartAxisLabelStyle.Font>
<Font FontSize="9" FontAttributes="Bold" />
</chart:ChartAxisLabelStyle.Font>
</chart:ChartAxisLabelStyle>
</chart:CategoryAxis.LabelStyle>
</chart:CategoryAxis>
</chart:SfChart.PrimaryAxis>
<chart:SfChart.SecondaryAxis>
<chart:NumericalAxis Interval="2" Maximum="110" Minimum="90">
<chart:NumericalAxis.MajorTickStyle>
<chart:ChartAxisTickStyle TickSize="7" StrokeColor="#0B4940" StrokeWidth="3" />
</chart:NumericalAxis.MajorTickStyle>
<chart:NumericalAxis.MinorTickStyle>
<chart:ChartAxisTickStyle TickSize="5" StrokeColor="Green" StrokeWidth="2" />
</chart:NumericalAxis.MinorTickStyle>
<chart:NumericalAxis.Title>
<chart:ChartAxisTitle Text="Temperature °F" />
</chart:NumericalAxis.Title>
</chart:NumericalAxis>
</chart:SfChart.SecondaryAxis>
<chart:SfChart.Series>
<chart:SplineSeries EnableDataPointSelection="true" Color="#0B4940" x:Name="Charts" XBindingPath="XValue" YBindingPath="YValue">
<chart:SplineSeries.DataMarker>
<chart:ChartDataMarker ShowLabel="False" ShowMarker="True" MarkerType="Hexagon" MarkerWidth="5" MarkerHeight="5" MarkerColor="Red" MarkerBorderColor="Red" MarkerBorderWidth="2" />
</chart:SplineSeries.DataMarker>
</chart:SplineSeries>
</chart:SfChart.Series>
</chart:SfChart>

Gobi M [Syncfusion]
Replied On May 25, 2016 08:18 AM

Hi Atif, 
 
Thanks for using Syncfusion products. 
 
We are able achieve your requirement for change chart type in runtime. We have prepared a sample for this and it can be downloaded in the below link. 
 
 
Please let us know if you need any further assistance.  
 
Regards, 
Gobi M 


Atif
Replied On May 26, 2016 11:52 AM

Thanks a lot.

Gobi M [Syncfusion]
Replied On May 27, 2016 05:02 AM

Hi Atif, 
 
Thanks for the update. 
 
Please let us know if you have any other queries. 
 
Regards, 
Gobi M 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;