You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Flutter/cartesian-charts/multiple-charts.md
+18-7Lines changed: 18 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,6 +18,12 @@ You can add multiple series to the [`series`](https://pub.dev/documentation/sync
18
18
19
19
@override
20
20
Widget build(BuildContext context) {
21
+
final List<ChartData> chartData = <ChartData>[
22
+
ChartData('Germany', 128, 129, 101),
23
+
ChartData('Russia', 123, 92, 93),
24
+
ChartData('Norway', 107, 106, 90),
25
+
ChartData('USA', 87, 95, 71),
26
+
];
21
27
return Scaffold(
22
28
body: Center(
23
29
child: Container(
@@ -47,7 +53,7 @@ You can add multiple series to the [`series`](https://pub.dev/documentation/sync
47
53
}
48
54
49
55
class ChartData {
50
-
ChartData(this.x, this.y, this.y2, this.y3);
56
+
ChartData(this.x, this.y, this.y1, this.y2);
51
57
final String x;
52
58
final double? y;
53
59
final double? y1;
@@ -68,6 +74,12 @@ Also refer [multiple axes](./axis-customization#multiple-axes) for customizing t
68
74
69
75
@override
70
76
Widget build(BuildContext context) {
77
+
final List<ChartData> chartData = <ChartData>[
78
+
ChartData('Germany', 129),
79
+
ChartData('Russia', 90),
80
+
ChartData('USA', 107),
81
+
ChartData('Norway', 68),
82
+
];
71
83
return Scaffold(
72
84
body: Center(
73
85
child: Container(
@@ -84,7 +96,7 @@ Also refer [multiple axes](./axis-customization#multiple-axes) for customizing t
84
96
LineSeries<ChartData, String>(
85
97
dataSource: chartData,
86
98
xValueMapper: (ChartData data, _) => data.x,
87
-
yValueMapper: (ChartData data, _) => data.y1
99
+
yValueMapper: (ChartData data, _) => data.y
88
100
)
89
101
]
90
102
)
@@ -94,10 +106,9 @@ Also refer [multiple axes](./axis-customization#multiple-axes) for customizing t
94
106
}
95
107
96
108
class ChartData {
97
-
ChartData(this.x, this.y, this.y1);
109
+
ChartData(this.x, this.y);
98
110
final String x;
99
111
final double? y;
100
-
final double? y1;
101
112
}
102
113
103
114
{% endhighlight %}
@@ -108,6 +119,6 @@ Also refer [multiple axes](./axis-customization#multiple-axes) for customizing t
108
119
109
120
* Cartesian type series cannot be combined with circular series (pie, doughnut, and radial bar).
110
121
111
-
>**NOTE**:`chartData` in the above code snippets is a class type list and holds the data for binding to the chart series. Refer [Bind data source](https://help.syncfusion.com/flutter/cartesian-charts/getting-started#bind-data-source) topic for more details.
112
-
113
-
N> You can refer to our [Flutter Combination Chart](https://www.syncfusion.com/flutter-widgets/flutter-charts/chart-types/combination-chart) feature tour page for its groundbreaking feature representations.
122
+
>**Note**:
123
+
*`chartData` in the above code snippets is a class type list and holds the data for binding to the chart series. Refer [Bind data source](https://help.syncfusion.com/flutter/cartesian-charts/getting-started#bind-data-source) topic for more details.
124
+
* You can refer to our [Flutter Combination Chart](https://www.syncfusion.com/flutter-widgets/flutter-charts/chart-types/combination-chart) feature tour page for its groundbreaking feature representations.
0 commit comments