<chart:SfChart x:Name="Chart" VerticalOptions="FillAndExpand" HeightRequest="200" >
<chart:SfChart.ChartBehaviors>
<chart:ChartZoomPanBehavior EnableSelectionZooming="False" MaximumZoomLevel="0" EnableDoubleTap="True" />
</chart:SfChart.ChartBehaviors>
<chart:SfChart.PrimaryAxis>
<chart:CategoryAxis EnableAutoIntervalOnZooming="False">
<chart:CategoryAxis.Title>
<chart:ChartAxisTitle Text="Months"/>
</chart:CategoryAxis.Title>
</chart:CategoryAxis>
</chart:SfChart.PrimaryAxis>
<chart:SfChart.SecondaryAxis>
<chart:NumericalAxis >
<chart:NumericalAxis.Title>
<chart:ChartAxisTitle Text="Salary"/>
</chart:NumericalAxis.Title>
</chart:NumericalAxis>
</chart:SfChart.SecondaryAxis>
<chart:SfChart.Series>
<chart:FastLineSeries EnableTooltip="true" ListenPropertyChange="True"
XBindingPath="Month"
YBindingPath="Salary"
EnableAntiAliasing="False"
ItemsSource="{Binding ChartData}"
EnableAnimation="False" StrokeWidth="1"/>
</chart:SfChart.Series>
</chart:SfChart>
This chart:SfChart is inside scroll view
I have made a property in View Model
private ObservableCollection<ChartDataModel> _chartData = new ObservableCollection<ChartDataModel>();
public ObservableCollection<ChartDataModel> ChartData
{
get => _chartData;
set
{
_chartData = value;
RaisePropertyChanged();
MeasureRenderingTime();
}
}
-------------------------------------------------------------***************************_________________________________________
Fist Step - In Initilize function of View Model , I have made a call , which works pretty fine , But when i change the value in drop down and wish to get the desired output in charts , Nothing is shown , I have to zoom in zoom out 2- 3 times , then data loads .
Attachment:
Video_a55a633e.zip