Skip to content

WPF-956968-Updated the WPF KB sample and readme file #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# How-to-customize-the-appearance-of-axis-labels-in-WPF-Chart
This sample demonstrate how to customize the appearance of axis labels in WPF Chart.
# How to customize the appearance of axis labels in WPF Chart
This sample demonstrate how to customize the appearance of axis labels in [WPF Chart](https://www.syncfusion.com/wpf-controls/charts).

[WPF SfChart](https://help.syncfusion.com/wpf/charts/getting-started) supports customizing the appearance of the axis labels using the [LabelTemplate](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Charts.ChartAxis.html#Syncfusion_UI_Xaml_Charts_ChartAxis_LabelTemplate) property of the Chart axis with the following steps:

Expand Down Expand Up @@ -88,7 +88,10 @@ Step 3: Customize the axis labels using `LabelTemplate` property of the Chart ax

![Customize chart axis labels in the WPF Chart](https://user-images.githubusercontent.com/61832185/209123493-97c5a17e-db8a-47cd-a652-1aefe36faf87.png)

## <a name="troubleshooting"></a>Troubleshooting ##
### Path too long exception
If you are facing path too long exception when building this example project, close Visual Studio and rename the repository to short and build the project.
## 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 the appearance of axis labels in WPF Chart](https://support.syncfusion.com/kb/article/12176/how-to-customize-the-appearance-of-axis-labels-in-wpf-chart-sfchart)
6 changes: 0 additions & 6 deletions WPF_SfChart_Customize_AxisLabels/App.config

This file was deleted.

19 changes: 8 additions & 11 deletions WPF_SfChart_Customize_AxisLabels/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
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 WPF_SfChart_Customize_AxisLabels
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
{
}
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
{
}

}
10 changes: 10 additions & 0 deletions WPF_SfChart_Customize_AxisLabels/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +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)
)]
8 changes: 1 addition & 7 deletions WPF_SfChart_Customize_AxisLabels/ChartModel.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WPF_SfChart_Customize_AxisLabels
namespace WPF_SfChart_Customize_AxisLabels
{
public class ChartModel
{
Expand Down
3 changes: 2 additions & 1 deletion WPF_SfChart_Customize_AxisLabels/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:chart="clr-namespace:Syncfusion.UI.Xaml.Charts;assembly=Syncfusion.SfChart.WPF"
xmlns:local="clr-namespace:WPF_SfChart_Customize_AxisLabels"
xmlns:chart="http://schemas.syncfusion.com/wpf"
mc:Ignorable="d"
Title="MainWindow" Height="450" Width="800">

<Grid>
<Grid.DataContext>
<local:ViewModel />
Expand Down
37 changes: 12 additions & 25 deletions WPF_SfChart_Customize_AxisLabels/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,28 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Windows;

namespace WPF_SfChart_Customize_AxisLabels
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
}
}
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
}
}
55 changes: 0 additions & 55 deletions WPF_SfChart_Customize_AxisLabels/Properties/AssemblyInfo.cs

This file was deleted.

71 changes: 0 additions & 71 deletions WPF_SfChart_Customize_AxisLabels/Properties/Resources.Designer.cs

This file was deleted.

117 changes: 0 additions & 117 deletions WPF_SfChart_Customize_AxisLabels/Properties/Resources.resx

This file was deleted.

Loading