Not able to set Xaxis from xamarin MVVM viewmodel
Opened this issue · 1 comments
`public CombinedChartData chartView { get; set; }
XAsix = new XAxisConfig();
XAsix.XAXISPosition = XAXISPosition.BOTTOM;
XAsix.DrawGridLines = false;
XAsix.LabelRotationAngle = 90;
XAsix.AxisValueFormatter = new TextByIndexXAxisFormatter(labels);
ChartView.XAsix = XAsix;`
showing error that CombinedChartData doesnot contain a defanition for Xaxis
<ultimateChart:SupportBarChartExtended x:Name="chart" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" HeightRequest="250" WidthRequest="200" ChartData="{Binding ChartView}" />
I used YAxis, but may be the same. Try to bind XAxis property in the XAML.
` YAxisConfig axisLeft, axisRight;
public YAxisConfig AxisLeft { get => axisLeft; }
public YAxisConfig AxisRight { get => axisRight; }
...
...
...
axisLeft = new YAxisConfig()
{
DrawGridLines = false,
DrawAxisLine = true,
Enabled = true
};
axisRight = new YAxisConfig()
{
DrawAxisLine = false,
DrawGridLines = false,
Enabled = false
};`
<UltimateChart:SupportLineChartExtended Margin="10" x:Name="chart" ChartData="{Binding Data4}" AxisLeft="{Binding AxisLeft}" AxisRight="{Binding AxisRight}"/>