diff --git a/README.md b/README.md index 16808af..f0b8e04 100644 --- a/README.md +++ b/README.md @@ -95,11 +95,19 @@ WPF SfChart provides support for formatting axis labels based on axis intervals ![Output](https://user-images.githubusercontent.com/105482474/211509266-b28301df-9f64-4c2b-8f79-e9cf258b2723.png) +## Troubleshooting + +#### Path too long exception + +If you are facing a path too long exception when building this example project, close Visual Studio and rename the repository to a shorter name before building the project. + +For more details, refer to the KB on [How to format TimeSpanAxis label based on axis interval in WPF (SfChart)](https://support.syncfusion.com/kb/article/12317/how-to-format-timespanaxis-label-based-on-axis-interval-in-wpf-sfchart). + + ##See Also [Axis labels for TimeSpanAxis in WPF (SfChart)](https://help.syncfusion.com/wpf/charts/axis#axis-labels) [How to display the axis labels in a particular format](https://www.syncfusion.com/kb/3318/how-to-display-the-axis-labels-in-a-particular-format-of-wpf-chart-sfchart) - -[How to customize label formats of data-time axis during the interval transitions](https://www.syncfusion.com/kb/6940/how-to-customize-the-label-formats-of-date-time-axis-during-interval-transitions-in-wpf) +[How to customize label formats of data-time axis during the interval transitions](https://www.syncfusion.com/kb/6940/how-to-customize-the-label-formats-of-date-time-axis-during-interval-transitions-in-wpf) diff --git a/TimeSpanAxis/TimeSpanAxis/App.xaml b/TimeSpanAxis/TimeSpanAxis/App.xaml index 3c74a57..0bcd5f9 100644 --- a/TimeSpanAxis/TimeSpanAxis/App.xaml +++ b/TimeSpanAxis/TimeSpanAxis/App.xaml @@ -1,7 +1,7 @@ - diff --git a/TimeSpanAxis/TimeSpanAxis/App.xaml.cs b/TimeSpanAxis/TimeSpanAxis/App.xaml.cs index 8b079b9..5a488a1 100644 --- a/TimeSpanAxis/TimeSpanAxis/App.xaml.cs +++ b/TimeSpanAxis/TimeSpanAxis/App.xaml.cs @@ -1,12 +1,8 @@ -using System; -using System.Collections.Generic; -using System.Configuration; +using System.Configuration; using System.Data; -using System.Linq; -using System.Threading.Tasks; using System.Windows; -namespace TimeSpanAxis_Sample +namespace TimeSpanAxis { /// /// Interaction logic for App.xaml @@ -14,4 +10,5 @@ namespace TimeSpanAxis_Sample public partial class App : Application { } + } diff --git a/TimeSpanAxis/TimeSpanAxis/AssemblyInfo.cs b/TimeSpanAxis/TimeSpanAxis/AssemblyInfo.cs index 8b5504e..b0ec827 100644 --- a/TimeSpanAxis/TimeSpanAxis/AssemblyInfo.cs +++ b/TimeSpanAxis/TimeSpanAxis/AssemblyInfo.cs @@ -1,10 +1,10 @@ using System.Windows; [assembly: ThemeInfo( - ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located - //(used if a resource is not found in the page, - // or application resource dictionaries) - ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located - //(used if a resource is not found in the page, - // app, or any theme specific resource dictionaries) + ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located + //(used if a resource is not found in the page, + // or application resource dictionaries) + ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located + //(used if a resource is not found in the page, + // app, or any theme specific resource dictionaries) )] diff --git a/TimeSpanAxis/TimeSpanAxis/DataPoint.cs b/TimeSpanAxis/TimeSpanAxis/DataPoint.cs new file mode 100644 index 0000000..50de559 --- /dev/null +++ b/TimeSpanAxis/TimeSpanAxis/DataPoint.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace TimeSpanAxis +{ + public class DataPoint + { + public TimeSpan Time { get; set; } + public double Distance { get; set; } + } +} diff --git a/TimeSpanAxis/TimeSpanAxis/TimeSpanAxis.csproj b/TimeSpanAxis/TimeSpanAxis/TimeSpanAxis.csproj index 71a107e..52478d0 100644 --- a/TimeSpanAxis/TimeSpanAxis/TimeSpanAxis.csproj +++ b/TimeSpanAxis/TimeSpanAxis/TimeSpanAxis.csproj @@ -2,8 +2,9 @@ WinExe - net6.0-windows + net8.0-windows enable + enable true diff --git a/TimeSpanAxis/TimeSpanAxis/ViewModel.cs b/TimeSpanAxis/TimeSpanAxis/ViewModel.cs new file mode 100644 index 0000000..9fec40d --- /dev/null +++ b/TimeSpanAxis/TimeSpanAxis/ViewModel.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace TimeSpanAxis +{ + public class ViewModel + { + public ObservableCollection Data { get; set; } + + public ViewModel() + { + Data = new ObservableCollection + { + new DataPoint { Time = new TimeSpan(0, 0, 0, 0, 0), Distance = 50 }, + new DataPoint { Time = new TimeSpan(0, 0, 0, 2), Distance = 100 }, + new DataPoint { Time = new TimeSpan(0, 0, 0, 4), Distance = 200 }, + new DataPoint { Time = new TimeSpan(0, 0, 0, 6), Distance = 350 }, + new DataPoint { Time = new TimeSpan(0, 0, 0, 8), Distance = 500 }, + new DataPoint { Time = new TimeSpan(0, 0, 0, 10), Distance = 650 } + }; + } + } +}