Skip to content

Commit 90630ad

Browse files
Merge pull request #274 from syncfusion-content/Align_Chart_Code
Align the Code Snippets for Fast Scatter and Empty Point UG
2 parents 0fec72c + 7c66cd9 commit 90630ad

File tree

2 files changed

+105
-104
lines changed

2 files changed

+105
-104
lines changed

maui-toolkit/Cartesian-Charts/EmptyPoints.md

Lines changed: 70 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ The data collection that is passed to the chart can have NaN or Null values that
1717

1818
{% highlight C# %}
1919

20-
ProductSales = new ObservableCollection<Model>();
21-
ProductSales.Add(new Model() { Product = "Electronics", Sales = 60 });
22-
ProductSales.Add(new Model() { Product = "Clothing", Sales = 40 });
23-
ProductSales.Add(new Model() { Product = "Groceries", Sales = double.NaN });
24-
ProductSales.Add(new Model() { Product = "Furniture", Sales = 70 });
25-
ProductSales.Add(new Model() { Product = "Toys", Sales = 30 });
26-
ProductSales.Add(new Model() { Product = "Sports", Sales = double.NaN });
27-
ProductSales.Add(new Model() { Product = "Books", Sales = 50 });
20+
ProductSales = new ObservableCollection<Model>();
21+
ProductSales.Add(new Model() { Product = "Electronics", Sales = 60 });
22+
ProductSales.Add(new Model() { Product = "Clothing", Sales = 40 });
23+
ProductSales.Add(new Model() { Product = "Groceries", Sales = double.NaN });
24+
ProductSales.Add(new Model() { Product = "Furniture", Sales = 70 });
25+
ProductSales.Add(new Model() { Product = "Toys", Sales = 30 });
26+
ProductSales.Add(new Model() { Product = "Sports", Sales = double.NaN });
27+
ProductSales.Add(new Model() { Product = "Books", Sales = 50 });
2828

2929
{% endhighlight %}
3030

@@ -47,34 +47,34 @@ The following code example shows the [EmptyPointMode](https://help.syncfusion.co
4747

4848
{% highlight xaml %}
4949

50-
<chart:SfCartesianChart>
50+
<chart:SfCartesianChart>
5151

52-
.....
53-
<chart:LineSeries ItemsSource="{Binding ProductSales}"
52+
.....
53+
<chart:LineSeries ItemsSource="{Binding ProductSales}"
5454
XBindingPath="Product"
5555
YBindingPath="Sales"
5656
EmptyPointMode="Zero">
57-
</chart:LineSeries>
57+
</chart:LineSeries>
5858

59-
</chart:SfCartesianChart>
59+
</chart:SfCartesianChart>
6060

6161
{% endhighlight %}
6262

6363
{% highlight c# %}
6464

65-
SfCartesianChart chart = new SfCartesianChart();
65+
SfCartesianChart chart = new SfCartesianChart();
6666

67-
.....
68-
LineSeries series = new LineSeries()
69-
{
70-
ItemsSource = new ViewModel().ProductSales,
71-
XBindingPath = "Product",
72-
YBindingPath = "Sales",
73-
EmptyPointMode = EmptyPointMode.Zero
74-
};
67+
.....
68+
LineSeries series = new LineSeries()
69+
{
70+
ItemsSource = new ViewModel().ProductSales,
71+
XBindingPath = "Product",
72+
YBindingPath = "Sales",
73+
EmptyPointMode = EmptyPointMode.Zero
74+
};
7575

76-
chart.Series.Add(series);
77-
this.Content = chart;
76+
chart.Series.Add(series);
77+
this.Content = chart;
7878

7979
{% endhighlight %}
8080

@@ -88,34 +88,34 @@ The following code example shows the [EmptyPointMode](https://help.syncfusion.co
8888

8989
{% highlight xaml %}
9090

91-
<chart:SfCartesianChart>
91+
<chart:SfCartesianChart>
9292

93-
.....
94-
<chart:ColumnSeries ItemsSource="{Binding ProductSales}"
93+
.....
94+
<chart:ColumnSeries ItemsSource="{Binding ProductSales}"
9595
XBindingPath="Product"
9696
YBindingPath="Sales"
9797
EmptyPointMode="Average">
98-
</chart:ColumnSeries>
98+
</chart:ColumnSeries>
9999

100-
</chart:SfCartesianChart>
100+
</chart:SfCartesianChart>
101101

102102
{% endhighlight %}
103103

104104
{% highlight c# %}
105105

106-
SfCartesianChart chart = new SfCartesianChart();
106+
SfCartesianChart chart = new SfCartesianChart();
107107

108-
.....
109-
ColumnSeries series = new ColumnSeries()
110-
{
111-
ItemsSource = new ViewModel().ProductSales,
112-
XBindingPath = "Product",
113-
YBindingPath = "Sales",
114-
EmptyPointMode = EmptyPointMode.Average
115-
};
108+
.....
109+
ColumnSeries series = new ColumnSeries()
110+
{
111+
ItemsSource = new ViewModel().ProductSales,
112+
XBindingPath = "Product",
113+
YBindingPath = "Sales",
114+
EmptyPointMode = EmptyPointMode.Average
115+
};
116116

117-
chart.Series.Add(series);
118-
this.Content = chart;
117+
chart.Series.Add(series);
118+
this.Content = chart;
119119

120120
{% endhighlight %}
121121

@@ -134,58 +134,58 @@ The [EmptyPointSettings](https://help.syncfusion.com/cr/maui-toolkit/Syncfusion.
134134

135135
{% highlight xaml %}
136136

137-
<chart:SfCartesianChart>
137+
<chart:SfCartesianChart>
138138

139-
.....
140-
<chart:LineSeries ItemsSource="{Binding ProductSales}"
139+
.....
140+
<chart:LineSeries ItemsSource="{Binding ProductSales}"
141141
XBindingPath="Product"
142142
YBindingPath="Sales"
143143
Fill="#3068F7"
144144
StrokeWidth="2"
145145
ShowMarkers="True"
146146
ShowDataLabels="True"
147147
EmptyPointMode="Average">
148-
<chart:LineSeries.EmptyPointSettings>
149-
<chart:EmptyPointSettings Fill="Orange" StrokeWidth="2"/>
150-
</chart:LineSeries.EmptyPointSettings>
151-
</chart:LineSeries>
148+
<chart:LineSeries.EmptyPointSettings>
149+
<chart:EmptyPointSettings Fill="Orange" StrokeWidth="2"/>
150+
</chart:LineSeries.EmptyPointSettings>
151+
</chart:LineSeries>
152152

153-
</chart:SfCartesianChart>
153+
</chart:SfCartesianChart>
154154

155155
{% endhighlight %}
156156

157157
{% highlight c# %}
158158

159-
SfCartesianChart chart = new SfCartesianChart();
159+
SfCartesianChart chart = new SfCartesianChart();
160160

161-
.....
162-
LineSeries series = new LineSeries()
163-
{
164-
ItemsSource = new ViewModel().ProductSales,
165-
XBindingPath = "Product",
166-
YBindingPath = "Sales",
167-
Fill = Color.FromArgb("#3068F7"),
168-
StrokeWidth = 2,
169-
ShowMarkers = true,
170-
ShowDataLabels = true,
171-
EmptyPointMode = EmptyPointMode.Average
172-
};
161+
.....
162+
LineSeries series = new LineSeries()
163+
{
164+
ItemsSource = new ViewModel().ProductSales,
165+
XBindingPath = "Product",
166+
YBindingPath = "Sales",
167+
Fill = Color.FromArgb("#3068F7"),
168+
StrokeWidth = 2,
169+
ShowMarkers = true,
170+
ShowDataLabels = true,
171+
EmptyPointMode = EmptyPointMode.Average
172+
};
173173

174-
EmptyPointSettings emptypointSettings = new EmptyPointSettings()
175-
{
176-
Fill = Colors.Orange,
177-
StrokeWidth = 2
178-
};
174+
EmptyPointSettings emptypointSettings = new EmptyPointSettings()
175+
{
176+
Fill = Colors.Orange,
177+
StrokeWidth = 2
178+
};
179179

180-
series.EmptyPointSettings = emptypointSettings;
180+
series.EmptyPointSettings = emptypointSettings;
181181

182-
chart.Series.Add(series);
183-
this.Content = chart;
182+
chart.Series.Add(series);
183+
this.Content = chart;
184184

185185
{% endhighlight %}
186186

187187
{% endtabs %}
188188

189189
![Customize EmptyPoints in MAUI Chart](EmptyPoints_images\Customize_EmptyPoints.png)
190190

191-
N> EmptyPoint support is not applicable for Histogram and BoxAndWhisker series.
191+
N> EmptyPoint support is not applicable for Histogram and BoxAndWhisker series.

maui-toolkit/Cartesian-Charts/FastScatter.md

Lines changed: 35 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -20,54 +20,55 @@ N> The Cartesian chart has [Series](https://help.syncfusion.com/cr/maui-toolkit/
2020

2121
{% highlight xaml %}
2222

23-
<chart:SfCartesianChart>
24-
<chart:SfCartesianChart.XAxes>
25-
<chart:NumericalAxis/>
26-
</chart:SfCartesianChart.XAxes>
23+
<chart:SfCartesianChart>
2724

28-
<chart:SfCartesianChart.YAxes>
29-
<chart:NumericalAxis/>
30-
</chart:SfCartesianChart.YAxes>
25+
<chart:SfCartesianChart.XAxes>
26+
<chart:NumericalAxis/>
27+
</chart:SfCartesianChart.XAxes>
3128

32-
<chart:FastScatterSeries ItemsSource="{Binding Data1}"
33-
XBindingPath="XValue"
34-
YBindingPath="YValue" />
29+
<chart:SfCartesianChart.YAxes>
30+
<chart:NumericalAxis/>
31+
</chart:SfCartesianChart.YAxes>
3532

36-
<chart:FastScatterSeries ItemsSource="{Binding Data2}"
37-
XBindingPath="XValue"
38-
YBindingPath="YValue" />
33+
<chart:FastScatterSeries ItemsSource="{Binding Data1}"
34+
XBindingPath="XValue"
35+
YBindingPath="YValue" />
3936

40-
</chart:SfCartesianChart>
37+
<chart:FastScatterSeries ItemsSource="{Binding Data2}"
38+
XBindingPath="XValue"
39+
YBindingPath="YValue" />
40+
41+
</chart:SfCartesianChart>
4142

4243
{% endhighlight %}
4344

4445
{% highlight c# %}
4546

46-
SfCartesianChart chart = new SfCartesianChart();
47+
SfCartesianChart chart = new SfCartesianChart();
4748

48-
NumericalAxis primaryAxis = new NumericalAxis();
49-
chart.XAxes.Add(primaryAxis);
49+
NumericalAxis primaryAxis = new NumericalAxis();
50+
chart.XAxes.Add(primaryAxis);
5051

51-
NumericalAxis secondaryAxis = new NumericalAxis();
52-
chart.YAxes.Add(secondaryAxis);
52+
NumericalAxis secondaryAxis = new NumericalAxis();
53+
chart.YAxes.Add(secondaryAxis);
5354

54-
FastScatterSeries scatterSeries1 = new FastScatterSeries
55-
{
56-
ItemsSource = new ViewModel().Data1,
57-
XBindingPath = "XValue",
58-
YBindingPath = "YValue",
59-
};
55+
FastScatterSeries scatterSeries1 = new FastScatterSeries
56+
{
57+
ItemsSource = new ViewModel().Data1,
58+
XBindingPath = "XValue",
59+
YBindingPath = "YValue",
60+
};
6061

61-
FastScatterSeries scatterSeries2 = new FastScatterSeries
62-
{
63-
ItemsSource = new ViewModel().Data2,
64-
XBindingPath = "XValue",
65-
YBindingPath = "XValue",
66-
};
62+
FastScatterSeries scatterSeries2 = new FastScatterSeries
63+
{
64+
ItemsSource = new ViewModel().Data2,
65+
XBindingPath = "XValue",
66+
YBindingPath = "XValue",
67+
};
6768

68-
chart.Series.Add(scatterSeries1);
69-
chart.Series.Add(scatterSeries2);
70-
this.Content = chart;
69+
chart.Series.Add(scatterSeries1);
70+
chart.Series.Add(scatterSeries2);
71+
this.Content = chart;
7172

7273
{% endhighlight %}
7374

0 commit comments

Comments
 (0)