From 5f9827eac94eb8ecc6ee7397a7bd7cafc06353d9 Mon Sep 17 00:00:00 2001 From: KompelliSravanSyncfusion Date: Wed, 14 May 2025 20:16:10 +0530 Subject: [PATCH 1/4] Updated the sample --- README.md | 8 +++++- TimeSpanAxis/TimeSpanAxis/App.xaml | 4 +-- TimeSpanAxis/TimeSpanAxis/App.xaml.cs | 9 +++---- TimeSpanAxis/TimeSpanAxis/AssemblyInfo.cs | 12 ++++----- TimeSpanAxis/TimeSpanAxis/DataPoint.cs | 14 ++++++++++ TimeSpanAxis/TimeSpanAxis/TimeSpanAxis.csproj | 5 ++-- TimeSpanAxis/TimeSpanAxis/ViewModel.cs | 27 +++++++++++++++++++ 7 files changed, 62 insertions(+), 17 deletions(-) create mode 100644 TimeSpanAxis/TimeSpanAxis/DataPoint.cs create mode 100644 TimeSpanAxis/TimeSpanAxis/ViewModel.cs diff --git a/README.md b/README.md index 16808af..a4ea0f9 100644 --- a/README.md +++ b/README.md @@ -101,5 +101,11 @@ WPF SfChart provides support for formatting axis labels based on axis intervals [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) +## 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 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..febbf4c 100644 --- a/TimeSpanAxis/TimeSpanAxis/TimeSpanAxis.csproj +++ b/TimeSpanAxis/TimeSpanAxis/TimeSpanAxis.csproj @@ -2,13 +2,14 @@ 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 } + }; + } + } +} From e6cad5d334f79013b84da0ba24783a661a36df13 Mon Sep 17 00:00:00 2001 From: KompelliSravanSyncfusion Date: Wed, 14 May 2025 23:36:20 +0530 Subject: [PATCH 2/4] Updated read me file --- README.md | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index a4ea0f9..c25dd46 100644 --- a/README.md +++ b/README.md @@ -95,17 +95,20 @@ 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) -## 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 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). From f89ed70be86f9b1a4f8594c98edb8c02ff4f6921 Mon Sep 17 00:00:00 2001 From: KompelliSravanSyncfusion Date: Fri, 16 May 2025 15:56:27 +0530 Subject: [PATCH 3/4] Updated version --- TimeSpanAxis/TimeSpanAxis/TimeSpanAxis.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TimeSpanAxis/TimeSpanAxis/TimeSpanAxis.csproj b/TimeSpanAxis/TimeSpanAxis/TimeSpanAxis.csproj index febbf4c..52478d0 100644 --- a/TimeSpanAxis/TimeSpanAxis/TimeSpanAxis.csproj +++ b/TimeSpanAxis/TimeSpanAxis/TimeSpanAxis.csproj @@ -9,7 +9,7 @@ - + From 6a2d5b3f5ab0f6ff5af279b5651fa332c3cccb62 Mon Sep 17 00:00:00 2001 From: KompelliSravanSyncfusion Date: Tue, 10 Jun 2025 12:40:53 +0530 Subject: [PATCH 4/4] Updated read me file --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index c25dd46..f0b8e04 100644 --- a/README.md +++ b/README.md @@ -109,6 +109,5 @@ For more details, refer to the KB on [How to format TimeSpanAxis label based on [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)