You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Similar to #1294
I edit the view model implementation of Axes/Shared example in the project.
Replace data type from int to TimeSpanPoint (or any other class type)
Delete Values property assign for both series, only null collection
Start the app, zoom out any chart then we got NaN on X axis
ViewModel.cs
usingSkiaSharp;usingLiveChartsCore;usingLiveChartsCore.SkiaSharpView;usingLiveChartsCore.SkiaSharpView.Painting;usingLiveChartsCore.Drawing;usingLiveChartsCore.Measure;usingLiveChartsCore.Defaults;publicclassViewModel{publicISeries[]SeriesCollection1{get;set;}publicISeries[]SeriesCollection2{get;set;}publicAxis[]X1{get;set;}publicAxis[]X2{get;set;}publicMarginDrawMargin{get;set;}publicViewModel(){SeriesCollection1=newISeries[]{newLineSeries<TimeSpanPoint>{}};SeriesCollection2=newISeries[]{newColumnSeries<TimeSpanPoint>{}};// ideally, when sharing an axis, you should set the // mark// initial limits for all the axes involved. // markvarpadding=3;varstart=0-padding;// var end = values1.Length - 1 + padding;X1=newAxis[]{newAxis{MinLimit=1,MaxLimit=2,CrosshairLabelsBackground=SKColors.OrangeRed.AsLvcColor(),CrosshairLabelsPaint=newSolidColorPaint(SKColors.White),CrosshairPaint=newSolidColorPaint(SKColors.OrangeRed.WithAlpha(50),4),CrosshairPadding=newPadding(8),Labeler= value =>value.ToString("N2")}};X2=newAxis[]{newAxis{MinLimit=1,MaxLimit=2,CrosshairPaint=newSolidColorPaint(SKColors.OrangeRed.WithAlpha(50),4)}};SharedAxes.Set(X1[0],X2[0]);// Force the chart to use 70px margin on the left, this way we can align both charts Y axes. // markDrawMargin=newMargin(70,Margin.Auto,Margin.Auto,Margin.Auto);}}
The text was updated successfully, but these errors were encountered:
c0nstexpr
changed the title
Axis Breaks When Chart Has no Data
Axis Breaks When Chart Has No Data
Dec 6, 2024
Similar to #1294
I edit the view model implementation of Axes/Shared example in the project.
ViewModel.cs
The text was updated successfully, but these errors were encountered: