@@ -12,13 +12,43 @@ class InteractiveChart extends StatefulWidget {
12
12
final List <CandleData > candles;
13
13
final ChartStyle style;
14
14
15
+ /// How the date/time label at the bottom are displayed.
16
+ ///
17
+ /// If null, it defaults to use yyyy-mm format if more than 20 data points
18
+ /// are visible in the current chart window, otherwise it uses mm-dd format.
15
19
final TimeLabelGetter ? timeLabel;
20
+
21
+ /// How the price labels on the right are displayed.
22
+ ///
23
+ /// If null, it defaults to show 2 digits after the decimal point.
16
24
final PriceLabelGetter ? priceLabel;
25
+
26
+ /// How the overlay info are displayed, when user touches the chart.
27
+ ///
28
+ /// If null, it defaults to display `date` , `open` , `high` , `low` , `close`
29
+ /// and `volume` fields when user selects a data point in the chart.
30
+ ///
31
+ /// To customize it, pass in a function that returns a Map<String,String>:
32
+ /// ```dart
33
+ /// return {
34
+ /// "Date": "Customized date string goes here",
35
+ /// "Open": candle.open?.toStringAsFixed(2) ?? "-",
36
+ /// "Close": candle.close?.toStringAsFixed(2) ?? "-",
37
+ /// };
38
+ /// ```
17
39
final OverlayInfoGetter ? overlayInfo;
18
40
19
41
const InteractiveChart ({
20
42
Key ? key,
43
+
44
+ /// The full list of [CandleData] to be used for this chart.
45
+ ///
46
+ /// It needs to have at least 3 data points. If data is sufficiently large,
47
+ /// the chart will default to display the most recent 90 data points when
48
+ /// first opened, and allow user to freely zoom and pan however they like.
21
49
required this .candles,
50
+
51
+ /// If non-null, the style to use for this chart.
22
52
ChartStyle ? style,
23
53
this .timeLabel,
24
54
this .priceLabel,
0 commit comments