Skip to content

Commit db93a12

Browse files
Merge pull request #1395 from syncfusion-content/1024851_Code_Alignment_CartesianChart
1024851-Improve Code Alignment and Formatting for WinUI Cartesian Chart Documentation
2 parents 4c215de + fbd457c commit db93a12

36 files changed

Lines changed: 1428 additions & 1344 deletions

winui/Cartesian-Charts/Appearance.md

Lines changed: 36 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ Currently, Chart supports only one predefined palette and it is the default pale
3333
{% highlight c# %}
3434

3535
SfCartesianChart chart = new SfCartesianChart();
36-
3736
. . .
3837
this.Content = chart;
3938

@@ -60,6 +59,7 @@ this.Content = chart;
6059
{% highlight c# %}
6160

6261
SfCartesianChart chart = new SfCartesianChart();
62+
. . .
6363
List<Brush> CustomBrushes = new List<Brush>();
6464
CustomBrushes.Add(new SolidColorBrush(Color.FromArgb(255, 38, 198, 218)));
6565
CustomBrushes.Add(new SolidColorBrush(Color.FromArgb(255, 0, 172, 193)));
@@ -95,10 +95,11 @@ Cartesian chart provides support to set the palette to series for applying prede
9595
</chart:SfCartesianChart.Resources>
9696

9797
<chart:SfCartesianChart.Series>
98-
<chart:ColumnSeries ItemsSource="{Binding Data}"
99-
XBindingPath="Demand"
100-
YBindingPath="Year2010"
101-
PaletteBrushes="{StaticResource customBrushes}">
98+
<chart:ColumnSeries
99+
ItemsSource="{Binding Data}"
100+
XBindingPath="Demand"
101+
YBindingPath="Year2010"
102+
PaletteBrushes="{StaticResource customBrushes}">
102103
</chart:ColumnSeries>
103104
</chart:SfCartesianChart.Series>
104105

@@ -145,33 +146,34 @@ The following code sample and screenshot illustrates how to apply the gradient b
145146
<chart:SfCartesianChart.Resources>
146147
<BrushCollection x:Key="customBrushes">
147148
<LinearGradientBrush>
148-
<GradientStop Offset="1" Color="#FFE7C7" />
149-
<GradientStop Offset="0" Color="#FCB69F" />
149+
<GradientStop Offset="1" Color="#FFE7C7"/>
150+
<GradientStop Offset="0" Color="#FCB69F"/>
150151
</LinearGradientBrush>
151152
<LinearGradientBrush>
152-
<GradientStop Offset="1" Color="#fadd7d" />
153-
<GradientStop Offset="0" Color="#fccc2d" />
153+
<GradientStop Offset="1" Color="#fadd7d"/>
154+
<GradientStop Offset="0" Color="#fccc2d"/>
154155
</LinearGradientBrush>
155156
<LinearGradientBrush>
156-
<GradientStop Offset="1" Color="#DCFA97" />
157-
<GradientStop Offset="0" Color="#96E6A1" />
157+
<GradientStop Offset="1" Color="#DCFA97"/>
158+
<GradientStop Offset="0" Color="#96E6A1"/>
158159
</LinearGradientBrush>
159160
<LinearGradientBrush>
160-
<GradientStop Offset="1" Color="#DDD6F3" />
161-
<GradientStop Offset="0" Color="#FAACA8" />
161+
<GradientStop Offset="1" Color="#DDD6F3"/>
162+
<GradientStop Offset="0" Color="#FAACA8"/>
162163
</LinearGradientBrush>
163164
<LinearGradientBrush>
164-
<GradientStop Offset="1" Color="#A8EAEE" />
165-
<GradientStop Offset="0" Color="#7BB0F9" />
165+
<GradientStop Offset="1" Color="#A8EAEE"/>
166+
<GradientStop Offset="0" Color="#7BB0F9"/>
166167
</LinearGradientBrush>
167168
</BrushCollection>
168169
</chart:SfCartesianChart.Resources>
169170

170171
<chart:SfCartesianChart.Series>
171-
<chart:ColumnSeries ItemsSource="{Binding Data}"
172-
XBindingPath="Demand"
173-
YBindingPath="Year2010"
174-
PaletteBrushes="{StaticResource customBrushes}">
172+
<chart:ColumnSeries
173+
ItemsSource="{Binding Data}"
174+
XBindingPath="Demand"
175+
YBindingPath="Year2010"
176+
PaletteBrushes="{StaticResource customBrushes}">
175177
</chart:ColumnSeries>
176178
</chart:SfCartesianChart.Series>
177179

@@ -180,51 +182,51 @@ The following code sample and screenshot illustrates how to apply the gradient b
180182
{% highlight c# %}
181183

182184
SfCartesianChart chart = new SfCartesianChart();
183-
...
185+
. . .
184186
List<Brush> CustomBrushes = new List<Brush>();
185187
LinearGradientBrush gradientColor1 = new LinearGradientBrush();
186-
GradientStop stop1 = new GradientStop()
188+
GradientStop stop1 = new GradientStop()
187189
{
188-
Offset = 1,
189-
Color = Color.FromArgb(255, 255, 231, 199)
190+
Offset = 1,
191+
Color = Color.FromArgb(255, 255, 231, 199)
190192
};
191193

192-
GradientStop stop2 = new GradientStop()
194+
GradientStop stop2 = new GradientStop()
193195
{
194-
Offset = 0,
196+
Offset = 0,
195197
Color = Color.FromArgb(255, 252, 182, 159)
196198
};
197199

198200
gradientColor1.GradientStops.Add(stop1);
199201
gradientColor1.GradientStops.Add(stop2);
200202

201203
LinearGradientBrush gradientColor2 = new LinearGradientBrush();
202-
stop1 = new GradientStop()
204+
stop1 = new GradientStop()
203205
{
204-
Offset = 1,
205-
Color = Color.FromArgb(255, 250, 221, 125)
206+
Offset = 1,
207+
Color = Color.FromArgb(255, 250, 221, 125)
206208
};
207209

208-
stop2 = new GradientStop()
210+
stop2 = new GradientStop()
209211
{
210-
Offset = 0,
211-
Color = Color.FromArgb(255, 252, 204, 45)
212+
Offset = 0,
213+
Color = Color.FromArgb(255, 252, 204, 45)
212214
};
213215

214216
gradientColor2.GradientStops.Add(stop1);
215217
gradientColor2.GradientStops.Add(stop2);
216-
217-
...
218+
. . .
218219
CustomBrushes.Add(gradientColor1);
219220
CustomBrushes.Add(gradientColor2);
220-
...
221+
. . .
221222
ColumnSeries series = new ColumnSeries()
222223
{
223224
ItemsSource = new ViewModel().Data,
224225
XBindingPath = "Demand",
225226
YBindingPath = "Year2010",
226227
PaletteBrushes = CustomBrushes,
227228
};
229+
228230
chart.Series.Add(series);
229231
. . .
230232
this.Content = chart;

winui/Cartesian-Charts/Area.md

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,20 @@ The [WinUI Area Chart](https://www.syncfusion.com/winui-controls/charts/winui-ar
1919
{% highlight xaml %}
2020

2121
<chart:SfCartesianChart>
22-
2322
<chart:SfCartesianChart.XAxes>
24-
<chart:CategoryAxis />
23+
<chart:CategoryAxis/>
2524
</chart:SfCartesianChart.XAxes>
2625

2726
<chart:SfCartesianChart.YAxes>
28-
<chart:NumericalAxis />
29-
</chart:SfCartesianChart.YAxes>
27+
<chart:NumericalAxis/>
28+
</chart:SfCartesianChart.YAxes>
3029

3130
<chart:SfCartesianChart.Series>
32-
<chart:AreaSeries ItemsSource="{Binding Data}"
33-
XBindingPath="Demand"
34-
YBindingPath="Year2010"/>
31+
<chart:AreaSeries
32+
ItemsSource="{Binding Data}"
33+
XBindingPath="Demand"
34+
YBindingPath="Year2010"/>
3535
</chart:SfCartesianChart.Series>
36-
3736
</chart:SfCartesianChart>
3837

3938
{% endhighlight %}
@@ -43,6 +42,7 @@ The [WinUI Area Chart](https://www.syncfusion.com/winui-controls/charts/winui-ar
4342
SfCartesianChart chart = new SfCartesianChart();
4443
CategoryAxis xAxis = new CategoryAxis();
4544
chart.XAxes.Add(xAxis);
45+
4646
NumericalAxis yAxis = new NumericalAxis();
4747
chart.YAxes.Add(yAxis);
4848

@@ -71,21 +71,20 @@ The [SplineAreaSeries](https://help.syncfusion.com/cr/winui/Syncfusion.UI.Xaml.C
7171
{% highlight xaml %}
7272

7373
<chart:SfCartesianChart>
74-
7574
<chart:SfCartesianChart.XAxes>
76-
<chart:CategoryAxis />
75+
<chart:CategoryAxis/>
7776
</chart:SfCartesianChart.XAxes>
7877

7978
<chart:SfCartesianChart.YAxes>
80-
<chart:NumericalAxis />
79+
<chart:NumericalAxis/>
8180
</chart:SfCartesianChart.YAxes>
8281
8382
<chart:SfCartesianChart.Series>
84-
<chart:SplineAreaSeries ItemsSource="{Binding Data}"
85-
XBindingPath="Demand"
86-
YBindingPath="Year2010"/>
83+
<chart:SplineAreaSeries
84+
ItemsSource="{Binding Data}"
85+
XBindingPath="Demand"
86+
YBindingPath="Year2010"/>
8787
</chart:SfCartesianChart.Series>
88-
8988
</chart:SfCartesianChart>
9089

9190
{% endhighlight %}
@@ -95,6 +94,7 @@ The [SplineAreaSeries](https://help.syncfusion.com/cr/winui/Syncfusion.UI.Xaml.C
9594
SfCartesianChart chart = new SfCartesianChart();
9695
CategoryAxis primaryAxis = new CategoryAxis();
9796
chart.XAxes.Add(primaryAxis);
97+
9898
NumericalAxis secondaryAxis = new NumericalAxis();
9999
chart.YAxes.Add(secondaryAxis);
100100

@@ -125,19 +125,19 @@ The [StepAreaSeries](https://help.syncfusion.com/cr/winui/Syncfusion.UI.Xaml.Cha
125125
{% highlight xaml %}
126126

127127
<chart:SfCartesianChart>
128-
129128
<chart:SfCartesianChart.XAxes>
130-
<chart:CategoryAxis />
129+
<chart:CategoryAxis/>
131130
</chart:SfCartesianChart.XAxes>
132131

133132
<chart:SfCartesianChart.YAxes>
134-
<chart:NumericalAxis />
133+
<chart:NumericalAxis/>
135134
</chart:SfCartesianChart.YAxes>
136135

137136
<chart:SfCartesianChart.Series>
138-
<chart:StepAreaSeries XBindingPath="XValue"
139-
YBindingPath="YValue"
140-
ItemsSource="{Binding Data}"/>
137+
<chart:StepAreaSeries
138+
XBindingPath="XValue"
139+
YBindingPath="YValue"
140+
ItemsSource="{Binding Data}"/>
141141
</chart:SfCartesianChart.Series>
142142
...
143143
</chart:SfCartesianChart>
@@ -149,6 +149,7 @@ The [StepAreaSeries](https://help.syncfusion.com/cr/winui/Syncfusion.UI.Xaml.Cha
149149
SfCartesianChart chart = new SfCartesianChart();
150150
CategoryAxis xAxis = new CategoryAxis();
151151
chart.XAxes.Add(xAxis);
152+
152153
NumericalAxis yAxis = new NumericalAxis();
153154
chart.YAxes.Add(yAxis);
154155

winui/Cartesian-Charts/Axis/AutoScrollingDelta.md

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,19 @@ By adding the [ChartZoomPanBehavior](https://help.syncfusion.com/cr/winui/Syncfu
2424
{% highlight xaml %}
2525

2626
<chart:SfCartesianChart x:Name="chart" >
27-
...
28-
<chart:SfCartesianChart.XAxes>
29-
<chart:NumericalAxis AutoScrollingDelta="3" />
30-
</chart:SfCartesianChart.XAxes>
27+
...
28+
<chart:SfCartesianChart.XAxes>
29+
<chart:NumericalAxis AutoScrollingDelta="3"/>
30+
</chart:SfCartesianChart.XAxes>
3131

32-
<chart:SfCartesianChart.YAxes>
33-
<chart:NumericalAxis />
34-
</chart:SfCartesianChart.YAxes>
32+
<chart:SfCartesianChart.YAxes>
33+
<chart:NumericalAxis/>
34+
</chart:SfCartesianChart.YAxes>
3535

36-
<chart:SfCartesianChart.ZoomPanBehavior>
37-
<chart:ChartZoomPanBehavior EnablePanning="True" />
38-
</chart:SfCartesianChart.ZoomPanBehavior>
39-
...
36+
<chart:SfCartesianChart.ZoomPanBehavior>
37+
<chart:ChartZoomPanBehavior EnablePanning="True"/>
38+
</chart:SfCartesianChart.ZoomPanBehavior>
39+
...
4040
</chart:SfCartesianChart>
4141

4242
{% endhighlight %}
@@ -79,19 +79,19 @@ The [AutoScrollingMode](https://help.syncfusion.com/cr/winui/Syncfusion.UI.Xaml.
7979
{% highlight xaml %}
8080

8181
<chart:SfCartesianChart x:Name="chart" >
82-
...
83-
<chart:SfCartesianChart.XAxes>
84-
<chart:NumericalAxis AutoScrollingDelta="3" AutoScrollingMode="Start" />
85-
</chart:SfCartesianChart.XAxes>
82+
...
83+
<chart:SfCartesianChart.XAxes>
84+
<chart:NumericalAxis AutoScrollingDelta="3" AutoScrollingMode="Start"/>
85+
</chart:SfCartesianChart.XAxes>
8686

87-
<chart:SfCartesianChart.YAxes>
88-
<chart:NumericalAxis />
89-
</chart:SfCartesianChart.YAxes>
87+
<chart:SfCartesianChart.YAxes>
88+
<chart:NumericalAxis/>
89+
</chart:SfCartesianChart.YAxes>
9090

91-
<chart:SfCartesianChart.ZoomPanBehavior>
92-
<chart:ChartZoomPanBehavior EnablePanning="True" />
93-
</chart:SfCartesianChart.ZoomPanBehavior>
94-
...
91+
<chart:SfCartesianChart.ZoomPanBehavior>
92+
<chart:ChartZoomPanBehavior EnablePanning="True"/>
93+
</chart:SfCartesianChart.ZoomPanBehavior>
94+
...
9595
</chart:SfCartesianChart>
9696

9797
{% endhighlight %}
@@ -132,22 +132,22 @@ In the [DateTimeAxis](https://help.syncfusion.com/cr/winui/Syncfusion.UI.Xaml.Ch
132132

133133
{% highlight xaml %}
134134

135-
<chart:SfCartesianChart x:Name="chart" >
135+
<chart:SfCartesianChart x:Name="chart">
136136
...
137137
<chart:SfCartesianChart.XAxes>
138-
<chart:DateTimeAxis AutoScrollingDelta="4" AutoScrollingDeltaType="Months" >
138+
<chart:DateTimeAxis AutoScrollingDelta="1" AutoScrollingDeltaType="Months">
139139
<chart:DateTimeAxis.LabelStyle>
140-
<chart:LabelStyle LabelFormat="MMM-yy" />
140+
<chart:LabelStyle LabelFormat="MMM-yy"/>
141141
</chart:DateTimeAxis.LabelStyle>
142142
</chart:DateTimeAxis>
143143
</chart:SfCartesianChart.XAxes>
144144

145145
<chart:SfCartesianChart.YAxes>
146-
<chart:NumericalAxis />
146+
<chart:NumericalAxis/>
147147
</chart:SfCartesianChart.YAxes>
148148

149149
<chart:SfCartesianChart.ZoomPanBehavior>
150-
<chart:ChartZoomPanBehavior EnablePanning="True" />
150+
<chart:ChartZoomPanBehavior EnablePanning="True"/>
151151
</chart:SfCartesianChart.ZoomPanBehavior>
152152
...
153153
</chart:SfCartesianChart>

0 commit comments

Comments
 (0)