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
Copy file name to clipboardExpand all lines: README.md
+108-6Lines changed: 108 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@ The Horizontal Line Annotation includes following property:
12
12
13
13
Learn step-by-step instructions and gain insights to create and dynamically update the target line.
14
14
15
-
**Step 1:** The layout is created using a Grid with two columns.
15
+
**Step 1:** The layout is created using a grid with two columns.
16
16
17
17
**XAML**
18
18
@@ -27,7 +27,7 @@ Learn step-by-step instructions and gain insights to create and dynamically upda
27
27
</Grid>
28
28
```
29
29
30
-
**Step 2:** In first column of grid layout, initialize the [SfChart](https://help.syncfusion.com/wpf/charts/getting-started)and add the axes and series to the [SfChart](https://help.syncfusion.com/wpf/charts/getting-started) as shown below.
30
+
**Step 2:** In first column of grid layout, initialize the [SfChart](https://help.syncfusion.com/wpf/charts/getting-started)and add the axes and series as shown below.
31
31
32
32
**XAML**
33
33
@@ -50,7 +50,7 @@ Learn step-by-step instructions and gain insights to create and dynamically upda
50
50
<chart:ColumnSeries.ColorModel>
51
51
<chart:ChartColorModel>
52
52
<chart:ChartColorModel.CustomBrushes>
53
-
.....
53
+
......
54
54
</chart:ChartColorModel.CustomBrushes>
55
55
</chart:ChartColorModel>
56
56
</chart:ColumnSeries.ColorModel>
@@ -59,7 +59,8 @@ Learn step-by-step instructions and gain insights to create and dynamically upda
59
59
</chart:SfChart>
60
60
```
61
61
62
-
**Step 3:** The [HorizontalLineAnnotation](https://help.syncfusion.com/wpf/charts/annotations#vertical-and-horizontal-line-annotation) is initialized within the [Annotations](https://help.syncfusion.com/wpf/charts/annotations) collection of the [SfChart](https://help.syncfusion.com/wpf/charts/getting-started) to mark a dynamic target value on the Y-axis. The Y1 value is data-bound, enabling the target line to update dynamically based on the ViewModel.
62
+
**Step 3:** The [HorizontalLineAnnotation](https://help.syncfusion.com/wpf/charts/annotations#vertical-and-horizontal-line-annotation) is initialized within the [Annotations](https://help.syncfusion.com/wpf/charts/annotations) collection of the [SfChart](https://help.syncfusion.com/wpf/charts/getting-started) to mark a dynamic target value on the Y-axis. The Y1 property is data-bound to the ViewModel, allowing the target line to adjust dynamically when the value changes.
63
+
63
64
64
65
**XAML**
65
66
@@ -118,7 +119,7 @@ internal class ViewModel : INotifyPropertyChanged
118
119
}
119
120
```
120
121
121
-
**Step 4:** The second column of the grid layout contains a StackPanel with a Slider, TextBox and TextBlock, allowing the user to change the annotation value dynamically.
122
+
**Step 4:** The second column of the grid layout contains a StackPanel with a Slider, TextBox and TextBlock, allowing the user to change the annotation value dynamically. The TextBox_TextChanged event ensures valid input by clamping values between 0 and the maximum of the Y_Axis.
122
123
123
124
**XAML**
124
125
@@ -134,6 +135,107 @@ internal class ViewModel : INotifyPropertyChanged
**Step 5:** This XAML code for creates a grid layout with a chart and controls for adjusting a target line. The [SfChart](https://help.syncfusion.com/wpf/charts/getting-started) displays revenue data with a horizontal annotation line, adjustable using a TextBox and Slider in the adjacent StackPanel.
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.
147
249
148
-
For more details, refer to the KB on [how to create and dynamically update target line for WPF Chart?](https://support.syncfusion.com/agent/kb/18542).
250
+
For more details, refer to the KB on [how to create and dynamically update target line for WPF Chart](https://support.syncfusion.com/agent/kb/18542).
0 commit comments