Skip to content

Commit b9d9daa

Browse files
Merge pull request syncfusion-content#105 from syncfusion-content/flut-6089-events-hot
FLUT-6089 - [Others] Content changed
2 parents f290cf7 + 97429ec commit b9d9daa

File tree

4 files changed

+64
-58
lines changed

4 files changed

+64
-58
lines changed

Flutter/cartesian-charts/chart-types/candle-chart.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,13 @@ To render a Candle chart, create an instance of [` CandleSeries`](https://pub.de
4444
primaryXAxis: DateTimeAxis(),
4545
series: <ChartSeries>[
4646
// Renders CandleSeries
47-
CandleSeries<SalesData, DateTime>(
47+
CandleSeries<ChartData, DateTime>(
4848
dataSource: chartData,
49-
xValueMapper: (SalesData sales, _) => sales.year,
50-
lowValueMapper: (Sample sales, _) => sales.low,
51-
highValueMapper: (Sample sales, _) => sales.high,
52-
openValueMapper: (Sample sales, _) => sales.open,
53-
closeValueMapper: (Sample sales, _) => sales.close,
49+
xValueMapper: (ChartData sales, _) => sales.year,
50+
lowValueMapper: (ChartData sales, _) => sales.low,
51+
highValueMapper: (ChartData sales, _) => sales.high,
52+
openValueMapper: (ChartData sales, _) => sales.open,
53+
closeValueMapper: (ChartData sales, _) => sales.close,
5454

5555
)
5656
]

Flutter/cartesian-charts/chart-types/line-chart.md

Lines changed: 32 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -24,25 +24,24 @@ To render a line chart, create an instance of [`LineSeries`](https://pub.dev/doc
2424

2525
@override
2626
Widget build(BuildContext context) {
27-
final List<SalesData> chartData = [
28-
SalesData(2010, 35),
29-
SalesData(2011, 28),
30-
SalesData(2012, 34),
31-
SalesData(2013, 32),
32-
SalesData(2014, 40)
27+
final List<ChartData> chartData = [
28+
ChartData(2010, 35),
29+
ChartData(2011, 28),
30+
ChartData(2012, 34),
31+
ChartData(2013, 32),
32+
ChartData(2014, 40)
3333
];
3434

3535
return Scaffold(
3636
body: Center(
3737
child: Container(
3838
child: SfCartesianChart(
39-
primaryXAxis: DateTimeAxis(),
4039
series: <ChartSeries>[
4140
// Renders line chart
42-
LineSeries<SalesData, DateTime>(
41+
LineSeries<ChartData, int>(
4342
dataSource: chartData,
44-
xValueMapper: (SalesData sales, _) => sales.year,
45-
yValueMapper: (SalesData sales, _) => sales.sales
43+
xValueMapper: (ChartData sales, _) => sales.year,
44+
yValueMapper: (ChartData sales, _) => sales.sales
4645
)
4746
]
4847
)
@@ -51,9 +50,9 @@ To render a line chart, create an instance of [`LineSeries`](https://pub.dev/doc
5150
);
5251
}
5352

54-
class SalesData {
55-
SalesData(this.year, this.sales);
56-
final DateTime year;
53+
class ChartData {
54+
ChartData(this.year, this.sales);
55+
final int year;
5756
final double sales;
5857
}
5958

@@ -69,25 +68,25 @@ The [`dashArray`](https://pub.dev/documentation/syncfusion_flutter_charts/latest
6968

7069
@override
7170
Widget build(BuildContext context) {
72-
final List<SalesData> chartData = [
73-
SalesData("2010", 35),
74-
SalesData("2011", 28),
75-
SalesData('2012', 34),
76-
SalesData('2013', 32),
77-
SalesData('2014', 40)
71+
final List<ChartData> chartData = [
72+
ChartData("2010", 35),
73+
ChartData("2011", 28),
74+
ChartData('2012', 34),
75+
ChartData('2013', 32),
76+
ChartData('2014', 40)
7877
];
7978
return Scaffold(
8079
body: Center(
8180
child: Container(
8281
child: SfCartesianChart(
8382
primaryXAxis: DateTimeAxis(),
8483
series: <ChartSeries>[
85-
LineSeries<SalesData, DateTime>(
84+
LineSeries<ChartData, DateTime>(
8685
dataSource: chartData,
8786
// Dash values for line
8887
dashArray: <double>[5, 5],
89-
xValueMapper: (SalesData sales, _) => sales.year,
90-
yValueMapper: (SalesData sales, _) => sales.sales)
88+
xValueMapper: (ChartData sales, _) => sales.year,
89+
yValueMapper: (ChartData sales, _) => sales.sales)
9190
]
9291
)
9392
)
@@ -118,18 +117,18 @@ To render a multi-colored line series, map the individual colors to the data usi
118117
child: SfCartesianChart(
119118
primaryXAxis: CategoryAxis(),
120119
series: <ChartSeries>[
121-
LineSeries<SalesData, String>(
120+
LineSeries<ChartData, String>(
122121
dataSource: [
123-
SalesData('Jan', 35, Colors.red),
124-
SalesData('Feb', 28, Colors.green),
125-
SalesData('Mar', 34, Colors.blue),
126-
SalesData('Apr', 32, Colors.pink),
127-
SalesData('May', 40, Colors.black)
122+
ChartData('Jan', 35, Colors.red),
123+
ChartData('Feb', 28, Colors.green),
124+
ChartData('Mar', 34, Colors.blue),
125+
ChartData('Apr', 32, Colors.pink),
126+
ChartData('May', 40, Colors.black)
128127
],
129128
// Bind the color for all the data points from the data source
130-
pointColorMapper:(SalesData sales, _) => sales.segmentColor,
131-
xValueMapper: (SalesData sales, _) => sales.year,
132-
yValueMapper: (SalesData sales, _) => sales.sales
129+
pointColorMapper:(ChartData sales, _) => sales.segmentColor,
130+
xValueMapper: (ChartData sales, _) => sales.year,
131+
yValueMapper: (ChartData sales, _) => sales.sales
133132
)
134133
]
135134
)
@@ -138,8 +137,8 @@ To render a multi-colored line series, map the individual colors to the data usi
138137
);
139138
}
140139

141-
class SalesData {
142-
SalesData(this.year, this.sales, this.segmentColor);
140+
class ChartData {
141+
ChartData(this.year, this.sales, this.segmentColor);
143142
final String year;
144143
final double sales;
145144
final Color segmentColor;

Flutter/cartesian-charts/chart-types/waterfall-chart.md

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,13 @@ To render a waterfall chart, create an instance of [`WaterfallSeries`](https://p
1616
* [`negativePointsColor`](https://pub.dev/documentation/syncfusion_flutter_charts/latest/charts/WaterfallSeries/negativePointsColor.html) - changes the color of the negative data points in the series. If no color is specified, then the negative data points will be rendered with the series default color.
1717
* [`intermediateSumColor`](https://pub.dev/documentation/syncfusion_flutter_charts/latest/charts/WaterfallSeries/intermediateSumColor.html) - changes the color of the intermediate sum points in the series. If no color is specified, then the intermediate sum points will be rendered with the series default color.
1818
* [`totalSumColor`](https://pub.dev/documentation/syncfusion_flutter_charts/latest/charts/WaterfallSeries/totalSumColor.html) - changes the color of the total sum points in the series. If no color is specified, then the total sum points will be rendered with the series default color.
19+
* [`color`](https://pub.dev/documentation/syncfusion_flutter_charts/latest/charts/CartesianSeries/color.html) - changes the color of the series. If no color is specified, then the series will be rendered with the default palette color.
1920
* [`connectorLineSettings`](https://pub.dev/documentation/syncfusion_flutter_charts/latest/charts/WaterfallSeries/connectorLineSettings.html) - used to customize the waterfall chart connector line. Data points in waterfall chart are connected using the connector line. Provides the options to change the [`width`](https://pub.dev/documentation/syncfusion_flutter_charts/latest/charts/ConnectorLineSettings/width.html), [`color`](https://pub.dev/documentation/syncfusion_flutter_charts/latest/charts/ConnectorLineSettings/color.html) and [`dashArray`](https://pub.dev/documentation/syncfusion_flutter_charts/latest/charts/WaterfallConnectorLineSettings/dashArray.html) of the connector line to customize the appearance.
2021
* [`spacing`](https://pub.dev/documentation/syncfusion_flutter_charts/latest/charts/WaterfallSeries/spacing.html) - used to provide spacing between the data points in waterfall chart. The value ranges from 0 to 1, where 1 represents 100% and 0 represents 0% of the available space.
22+
* [`xValueMapper`](https://pub.dev/documentation/syncfusion_flutter_charts/latest/charts/CartesianSeries/xValueMapper.html) - field in the data source, which is considered as x-value.
23+
* [`yValueMapper`](https://pub.dev/documentation/syncfusion_flutter_charts/latest/charts/CartesianSeries/yValueMapper.html) - field in the data source, which is considered as y-value.
24+
* [`intermediateSumPredicate`](https://pub.dev/documentation/syncfusion_flutter_charts/latest/charts/CartesianSeries/intermediateSumPredicate.html) - the boolean value based on which the data point will be considered as an intermediate sum or not. If this has true value, then that point will be considered as an intermediate sum. Else if it has false, then it will be considered as a normal data point in the chart.
25+
* [`totalSumPredicate`](https://pub.dev/documentation/syncfusion_flutter_charts/latest/charts/CartesianSeries/totalSumPredicate.html) - the boolean value based on which the data point will be considered as the total sum or not. If this has true value, then that point will be considered as a total sum. Else if it has false, then it will be considered as a normal data point in the chart.
2126

2227
{% highlight dart %}
2328

@@ -29,29 +34,29 @@ To render a waterfall chart, create an instance of [`WaterfallSeries`](https://p
2934
child:SfCartesianChart(
3035
primaryXAxis:
3136
NumericAxis(minimum: 0, interval: 2, maximum: 12),
32-
series: <ChartSeries<SalesData, double>>[
33-
WaterfallSeries<SalesData, double>(
34-
dataSource: <SalesData>[
35-
SalesData(2, 10),
36-
SalesData(3, -3),
37-
SalesData(4, 5, true),
38-
SalesData(5, 4),
39-
SalesData(6, -2),
40-
SalesData(7, -5, true),
41-
SalesData(8, -10),
42-
SalesData(9, 8),
43-
SalesData(10, 8),
44-
SalesData(11, 5, false),
37+
series: <ChartSeries<ChartData, double>>[
38+
WaterfallSeries<ChartData, double>(
39+
dataSource: <ChartData>[
40+
ChartData(2, 10),
41+
ChartData(3, -3),
42+
ChartData(4, 5, true),
43+
ChartData(5, 4),
44+
ChartData(6, -2),
45+
ChartData(7, -5, true),
46+
ChartData(8, -10),
47+
ChartData(9, 8),
48+
ChartData(10, 8),
49+
ChartData(11, 5, false),
4550
],
4651
negativePointsColor: const Color.fromRGBO(229, 101, 144, 1),
4752
intermediateSumColor: const Color.fromRGBO(79, 129, 188, 1),
4853
totalSumColor: const Color.fromRGBO(79, 129, 188, 1),
4954
color: const Color.fromRGBO(0, 189, 174, 1),
50-
xValueMapper: (SalesData sales, _) => sales.x,
51-
yValueMapper: (SalesData sales, _) => sales.y,
52-
intermediateSumPredicate: (SalesData sales, _) =>
55+
xValueMapper: (ChartData sales, _) => sales.x,
56+
yValueMapper: (ChartData sales, _) => sales.y,
57+
intermediateSumPredicate: (ChartData sales, _) =>
5358
sales.isIntermediate,
54-
totalSumPredicate: (SalesData sales, _) => sales.isTotal,
59+
totalSumPredicate: (ChartData sales, _) => sales.isTotal,
5560
connectorLineSettings:
5661
WaterfallConnectorLineSettings(width: 2.5))
5762
]
@@ -61,8 +66,8 @@ To render a waterfall chart, create an instance of [`WaterfallSeries`](https://p
6166
);
6267
}
6368

64-
class SalesData {
65-
SalesData([this.x, this.y, this.isIntermediate, this.isTotal]);
69+
class ChartData {
70+
ChartData([this.x, this.y, this.isIntermediate, this.isTotal]);
6671
final double? x;
6772
final num? y;
6873
final bool? isIntermediate;

Flutter/cartesian-charts/trackball-crosshair.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,8 @@ The position of trackball tooltip can be changed using the [`tooltipAlignment`](
122122
* [`ChartAlignment.far`](https://pub.dev/documentation/syncfusion_flutter_charts/latest/charts/ChartAlignment.html) - aligns the trackball tooltip to the bottom position of plot area.
123123
* [`ChartAlignment.center`](https://pub.dev/documentation/syncfusion_flutter_charts/latest/charts/ChartAlignment.html) - aligns the trackball tooltip to the center position of plot area.
124124

125+
>**NOTE**: The [`tooltipAlignment`](https://pub.dev/documentation/syncfusion_flutter_charts/latest/charts/TrackballBehavior/tooltipAlignment.html) is only applicable for trackball display mode [`TrackballDisplayMode.groupAllPoints`](https://pub.dev/documentation/syncfusion_flutter_charts/latest/charts/TrackballDisplayMode.html).
126+
125127
{% highlight dart %}
126128

127129
late TrackballBehavior _trackballBehavior;

0 commit comments

Comments
 (0)