Skip to content

Commit bae74ab

Browse files
authored
Update README.md
1 parent 172ee2f commit bae74ab

File tree

1 file changed

+9
-40
lines changed

1 file changed

+9
-40
lines changed

README.md

Lines changed: 9 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -66,20 +66,13 @@ Learn step-by-step instructions and gain insights to create and dynamically upda
6666

6767
```xml
6868
<chart:SfChart Grid.Column="0">
69-
69+
.....
7070
<chart:SfChart.Annotations>
7171
<chart:HorizontalLineAnnotation Y1="{Binding Y1}"
72-
Stroke="Black"
73-
StrokeThickness="2"
74-
StrokeDashArray="5,2,2"
75-
Text="Target"
76-
FontSize="14"
77-
FontWeight="Bold"
78-
HorizontalTextAlignment="Left"
79-
VerticalTextAlignment="Top">
72+
....>
8073
</chart:HorizontalLineAnnotation>
8174
</chart:SfChart.Annotations>
82-
75+
.....
8376
</chart:SfChart>
8477
```
8578

@@ -178,27 +171,14 @@ private void TextBox_TextChanged(object sender, TextChangedEventArgs e)
178171
}
179172
}
180173
```
181-
182-
**Step 5:** This XAML code demonstrates a [SfChart](https://help.syncfusion.com/wpf/charts/getting-started) with dynamic updates to a horizontal target line annotation, bound to a ViewModel property. The chart includes X and Y axes, a column series, and customizable annotation styling.
174+
**Step 5:** This code defines a [HorizontalLineAnnotation](https://help.syncfusion.com/wpf/charts/annotations#vertical-and-horizontal-line-annotation)for a [SfChart](https://help.syncfusion.com/wpf/charts/getting-started), representing a horizontal line at a specified Y-axis value. It includes custom styling such as dashed stroke, text with font formatting, and text alignment settings.
183175

184176
**XAML**
185177

186178
```
187-
<Grid>
188-
<Grid.ColumnDefinitions>
189-
<ColumnDefinition Width="*"></ColumnDefinition>
190-
<ColumnDefinition Width="200"></ColumnDefinition>
191-
</Grid.ColumnDefinitions>
192-
193-
<chart:SfChart Grid.Column="0">
194-
195-
<chart:SfChart.PrimaryAxis>
196-
<chart:CategoryAxis EdgeLabelsDrawingMode="Fit" ShowGridLines="False" Header="Months"/>
197-
</chart:SfChart.PrimaryAxis>
179+
<chart:SfChart Grid.Column="0">
198180
199-
<chart:SfChart.SecondaryAxis>
200-
<chart:NumericalAxis x:Name="Y_Axis" Minimum="0" Maximum="20000" Interval="5000" ShowGridLines="False" Header="Revenue" LabelFormat="'$'0" PlotOffsetEnd="30"/>
201-
</chart:SfChart.SecondaryAxis>
181+
.....
202182
203183
<chart:SfChart.Annotations>
204184
<chart:HorizontalLineAnnotation Y1="{Binding Y1}"
@@ -213,20 +193,9 @@ private void TextBox_TextChanged(object sender, TextChangedEventArgs e)
213193
</chart:HorizontalLineAnnotation>
214194
</chart:SfChart.Annotations>
215195
216-
<chart:ColumnSeries ItemsSource="{Binding Data}"
217-
XBindingPath="Months"
218-
YBindingPath="Revenue"
219-
Palette="Custom"
220-
Opacity="0.7">
221-
<chart:ColumnSeries.ColorModel>
222-
<chart:ChartColorModel>
223-
.....
224-
</chart:ChartColorModel>
225-
</chart:ColumnSeries.ColorModel>
226-
</chart:ColumnSeries>
227-
228-
</chart:SfChart>
229-
</Grid>
196+
.....
197+
198+
</chart:SfChart>
230199
```
231200

232201
**Output:**

0 commit comments

Comments
 (0)