Skip to content

Commit 5f9827e

Browse files
Updated the sample
1 parent 7319f81 commit 5f9827e

File tree

7 files changed

+62
-17
lines changed

7 files changed

+62
-17
lines changed

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,5 +101,11 @@ WPF SfChart provides support for formatting axis labels based on axis intervals
101101

102102
[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)
103103

104-
[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)
104+
## Troubleshooting
105+
106+
#### Path too long exception
107+
108+
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.
109+
110+
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).
105111

TimeSpanAxis/TimeSpanAxis/App.xaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
<Application x:Class="TimeSpanAxis_Sample.App"
1+
<Application x:Class="TimeSpanAxis.App"
22
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
33
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4-
xmlns:local="clr-namespace:TimeSpanAxis_Sample"
4+
xmlns:local="clr-namespace:TimeSpanAxis"
55
StartupUri="MainWindow.xaml">
66
<Application.Resources>
77

TimeSpanAxis/TimeSpanAxis/App.xaml.cs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.Configuration;
1+
using System.Configuration;
42
using System.Data;
5-
using System.Linq;
6-
using System.Threading.Tasks;
73
using System.Windows;
84

9-
namespace TimeSpanAxis_Sample
5+
namespace TimeSpanAxis
106
{
117
/// <summary>
128
/// Interaction logic for App.xaml
139
/// </summary>
1410
public partial class App : Application
1511
{
1612
}
13+
1714
}
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
using System.Windows;
22

33
[assembly: ThemeInfo(
4-
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
5-
//(used if a resource is not found in the page,
6-
// or application resource dictionaries)
7-
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
8-
//(used if a resource is not found in the page,
9-
// app, or any theme specific resource dictionaries)
4+
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
5+
//(used if a resource is not found in the page,
6+
// or application resource dictionaries)
7+
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
8+
//(used if a resource is not found in the page,
9+
// app, or any theme specific resource dictionaries)
1010
)]
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
7+
namespace TimeSpanAxis
8+
{
9+
public class DataPoint
10+
{
11+
public TimeSpan Time { get; set; }
12+
public double Distance { get; set; }
13+
}
14+
}

TimeSpanAxis/TimeSpanAxis/TimeSpanAxis.csproj

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@
22

33
<PropertyGroup>
44
<OutputType>WinExe</OutputType>
5-
<TargetFramework>net6.0-windows</TargetFramework>
5+
<TargetFramework>net8.0-windows</TargetFramework>
66
<Nullable>enable</Nullable>
7+
<ImplicitUsings>enable</ImplicitUsings>
78
<UseWPF>true</UseWPF>
89
</PropertyGroup>
910

1011
<ItemGroup>
11-
<PackageReference Include="Syncfusion.SfChart.WPF" Version="*" />
12+
<PackageReference Include="Syncfusion.SfChart.WPF" Version="29.2.4" />
1213
</ItemGroup>
1314

1415
</Project>
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Collections.ObjectModel;
4+
using System.Linq;
5+
using System.Text;
6+
using System.Threading.Tasks;
7+
8+
namespace TimeSpanAxis
9+
{
10+
public class ViewModel
11+
{
12+
public ObservableCollection<DataPoint> Data { get; set; }
13+
14+
public ViewModel()
15+
{
16+
Data = new ObservableCollection<DataPoint>
17+
{
18+
new DataPoint { Time = new TimeSpan(0, 0, 0, 0, 0), Distance = 50 },
19+
new DataPoint { Time = new TimeSpan(0, 0, 0, 2), Distance = 100 },
20+
new DataPoint { Time = new TimeSpan(0, 0, 0, 4), Distance = 200 },
21+
new DataPoint { Time = new TimeSpan(0, 0, 0, 6), Distance = 350 },
22+
new DataPoint { Time = new TimeSpan(0, 0, 0, 8), Distance = 500 },
23+
new DataPoint { Time = new TimeSpan(0, 0, 0, 10), Distance = 650 }
24+
};
25+
}
26+
}
27+
}

0 commit comments

Comments
 (0)