Skip to content

Commit f2560da

Browse files
author
tineshsf4652
authored
Update README.md
1 parent 75d81c5 commit f2560da

File tree

1 file changed

+9
-41
lines changed

1 file changed

+9
-41
lines changed

README.md

Lines changed: 9 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -63,19 +63,14 @@ Learn step-by-step instructions and gain insights to create and dynamically upda
6363

6464
```xml
6565
<chart:SfCartesianChart Grid.Column="0">
66-
66+
.....
6767
<chart:SfCartesianChart.Annotations>
6868
<chart:HorizontalLineAnnotation Y1="{Binding Y1}"
69-
Stroke="Black"
70-
StrokeWidth="2"
71-
StrokeDashArray="5,2,2"
72-
Text="Target">
73-
<chart:HorizontalLineAnnotation.LabelStyle>
74-
<chart:ChartAnnotationLabelStyle TextColor="Black" FontSize="14" FontAttributes="Bold" HorizontalTextAlignment="Start" VerticalTextAlignment="Start"/>
75-
</chart:HorizontalLineAnnotation.LabelStyle>
69+
.....>
70+
......
7671
</chart:HorizontalLineAnnotation>
7772
</chart:SfCartesianChart.Annotations>
78-
73+
.....
7974
</chart:SfCartesianChart>
8075
```
8176

@@ -164,35 +159,14 @@ private void Entry_TextChanged(object sender, TextChangedEventArgs e)
164159
}
165160
```
166161

167-
**Step 5:** This XAML code demonstrates a [SfCartesianChart](https://help.syncfusion.com/maui/cartesian-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.
162+
**Step 5:** This code defines a [HorizontalLineAnnotation](https://help.syncfusion.com/maui/cartesian-charts/annotation#vertical-and-horizontal-line-annotations) in a [SfCartesianChart](https://help.syncfusion.com/maui/cartesian-charts/getting-started), marking a specific Y-axis value (Y1) with a styled dashed line and label. The label's appearance is customized using a [ChartAnnotationLabelStyle](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Charts.ChartAnnotationLabelStyle.html) for text color, size, font attributes, and alignment.
168163

169164
**XAML**
170165

171166
```xml
172-
<Grid>
173-
<Grid.ColumnDefinitions>
174-
<ColumnDefinition Width="*"></ColumnDefinition>
175-
<ColumnDefinition Width="200"></ColumnDefinition>
176-
</Grid.ColumnDefinitions>
177-
178-
<Grid.BindingContext>
179-
<local:ViewModel x:Name="viewModel"/>
180-
</Grid.BindingContext>
181-
182-
<chart:SfCartesianChart Grid.Column="0">
183-
184-
<chart:SfCartesianChart.XAxes>
185-
<chart:CategoryAxis ShowMajorGridLines="False">
186-
.....
187-
</chart:CategoryAxis>
188-
</chart:SfCartesianChart.XAxes>
189-
190-
<chart:SfCartesianChart.YAxes>
191-
<chart:NumericalAxis x:Name="Y_Axis" Minimum="0" Maximum="20000" Interval="5000" ShowMajorGridLines="False" PlotOffsetEnd="30">
192-
.....
193-
</chart:NumericalAxis>
194-
</chart:SfCartesianChart.YAxes>
195-
167+
<chart:SfCartesianChart Grid.Column="0">
168+
......
169+
196170
<chart:SfCartesianChart.Annotations>
197171
<chart:HorizontalLineAnnotation Y1="{Binding Y1}"
198172
Stroke="Black"
@@ -205,14 +179,8 @@ private void Entry_TextChanged(object sender, TextChangedEventArgs e)
205179
</chart:HorizontalLineAnnotation>
206180
</chart:SfCartesianChart.Annotations>
207181

208-
<chart:ColumnSeries ItemsSource="{Binding Data}"
209-
XBindingPath="Months"
210-
YBindingPath="Revenue"
211-
PaletteBrushes="{Binding CustomBrushes}"
212-
Opacity="0.7"/>
213-
182+
.....
214183
</chart:SfCartesianChart>
215-
</Grid>
216184
```
217185

218186
**Output:**

0 commit comments

Comments
 (0)