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

Change Chart type at runtime

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>

3 Replies

GM Gobi M Syncfusion Team May 25, 2016 12:18 PM UTC

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 



AT Atif May 26, 2016 03:52 PM UTC

Thanks a lot.


GM Gobi M Syncfusion Team May 27, 2016 09:02 AM UTC

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


Loader.
Live Chat Icon For mobile
Up arrow icon