Skip to content

Commit c6c2472

Browse files
committed
0.1.1: add some API docs for pub release
1 parent 389616e commit c6c2472

File tree

3 files changed

+37
-1
lines changed

3 files changed

+37
-1
lines changed

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## 0.1.1
2+
3+
* Improve performance.
4+
* Allow `high` and `low` prices to be optional.
5+
* Align date/time labels towards vertical bottom.
6+
17
## 0.1.0
28

39
* Initial Open Source release.

lib/interactive_chart.dart

+30
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,43 @@ class InteractiveChart extends StatefulWidget {
1212
final List<CandleData> candles;
1313
final ChartStyle style;
1414

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.
1519
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.
1624
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+
/// ```
1739
final OverlayInfoGetter? overlayInfo;
1840

1941
const InteractiveChart({
2042
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.
2149
required this.candles,
50+
51+
/// If non-null, the style to use for this chart.
2252
ChartStyle? style,
2353
this.timeLabel,
2454
this.priceLabel,

pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: interactive_chart
22
description: A candlestick chart that supports hand gestures such as pinch-to-zoom and panning.
3-
version: 0.1.0
3+
version: 0.1.1
44
homepage: https://github.com/h65wang/flutter-interactive-chart
55

66
environment:

0 commit comments

Comments
 (0)