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: CHANGELOG.md
+47-1Lines changed: 47 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,51 @@
1
-
## newVersion
1
+
## 1.2.0
2
2
***BUGFIX** (by @imaNNeo) Consider the `enabled` property in [LineTouchData](https://github.com/imaNNeo/fl_chart/blob/main/repo_files/documentations/line_chart.md#linetouchdata-read-about-touch-handling), [BarTouchData](https://github.com/imaNNeo/fl_chart/blob/main/repo_files/documentations/bar_chart.md#bartouchdata-read-about-touch-handling), [PieTouchData](https://github.com/imaNNeo/fl_chart/blob/main/repo_files/documentations/pie_chart.md#pietouchdata-read-about-touch-handling), [ScatterTouchData](https://github.com/imaNNeo/fl_chart/blob/main/repo_files/documentations/scatter_chart.md#scattertouchdata-read-about-touch-handling), [RadarTouchData](https://github.com/imaNNeo/fl_chart/blob/main/repo_files/documentations/radar_chart.md#radartouchdata-read-about-touch-handling) and [CandlestickTouchData](https://github.com/imaNNeo/fl_chart/blob/main/repo_files/documentations/candlestick_chart.md#candlesticktouchdata-read-about-touch-handling), #1676
3
+
***BREAKING** ⚠️ (by @huanghui1998hhh) Enhanced line chart curve function with a new extensible curve system. Introduced `LineChartCurve` abstract class. You can implement your own curve or use built-in curve: `LineChartCubicTensionCurve`(old curve implementation), and `LineChartCubicMonotoneCurve`.
4
+
**Migration Guide:**
5
+
6
+
Old API (deprecated):
7
+
```dart
8
+
LineChartBarData(
9
+
spots: spots,
10
+
isCurved: true,
11
+
curveSmoothness: 0.35,
12
+
preventCurveOverShooting: true,
13
+
preventCurveOvershootingThreshold: 10.0,
14
+
)
15
+
```
16
+
17
+
New API:
18
+
```dart
19
+
LineChartBarData(
20
+
spots: spots,
21
+
curve: LineChartCurve.cubicTension( // or use LineChartCubicTensionCurve()
22
+
smoothness: 0.35,
23
+
preventCurveOverShooting: true,
24
+
preventCurveOvershootingThreshold: 10.0,
25
+
),
26
+
)
27
+
```
28
+
29
+
Or use the new monotone curve:
30
+
```dart
31
+
LineChartBarData(
32
+
spots: spots,
33
+
curve: LineChartCurve.cubicMonotone( // or use LineChartCubicMonotoneCurve()
34
+
smooth: 0.5,
35
+
monotone: SmoothMonotone.x, // Prevents overshooting along X-axis
36
+
),
37
+
)
38
+
```
39
+
40
+
For straight lines (isCurved: false):
41
+
```dart
42
+
LineChartBarData(
43
+
spots: spots,
44
+
curve: LineChartCurve.noCurve, // or omit the curve parameter (default)
45
+
)
46
+
```
47
+
48
+
Check the updated [LineChart documentation](https://github.com/imaNNeo/fl_chart/blob/main/repo_files/documentations/line_chart.md#linechartcurve) for more details.
3
49
4
50
## 1.1.1
5
51
***IMPROVEMENT** (by @imaNNeo) Upgrade `vector_math` dependency to `2.2.0`, #1985
Copy file name to clipboardExpand all lines: repo_files/documentations/line_chart.md
+16-4Lines changed: 16 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -47,10 +47,7 @@ When you change the chart's state, it animates to the new state internally (usin
47
47
|gradient| You can use any [Gradient](https://api.flutter.dev/flutter/dart-ui/Gradient-class.html) here. such as [LinearGradient](https://api.flutter.dev/flutter/painting/LinearGradient-class.html) or [RadialGradient](https://api.flutter.dev/flutter/painting/RadialGradient-class.html)|null|
48
48
|gradientArea| determines the area where the gradient is applied |null|
49
49
|barWidth| gets the stroke width of the line bar|2.0|
50
-
|isCurved| curves the corners of the line on the spot's positions| false|
51
-
|curveSmoothness| smoothness radius of the curve corners (works when isCurved is true) | 0.35|
52
-
|preventCurveOverShooting|prevent overshooting when draw curve line on linear sequence spots, check this [issue](https://github.com/imaNNeo/fl_chart/issues/25)| false|
53
-
|preventCurveOvershootingThreshold|threshold for applying prevent overshooting algorithm | 10.0|
50
+
|curve| determines the curve style for drawing segments between spots (use [LineChartCurve](#LineChartCurve) types)| LineChartCurve.noCurve (straight lines)|
54
51
|isStrokeCapRound| determines whether start and end of the bar line is Qubic or Round | false|
55
52
|isStrokeJoinRound| determines whether stroke joins have a round shape or a sharp edge | false|
56
53
|belowBarData| check the [BarAreaData](#BarAreaData)|BarAreaData|
@@ -63,6 +60,21 @@ When you change the chart's state, it animates to the new state internally (usin
63
60
|lineChartStepData|Holds data for representing a Step Line Chart, and works only if [isStepChart] is true.|[LineChartStepData](#LineChartStepData)()|
64
61
|errorIndicatorData|Holds data for representing an error indicator (you see the error indicators if you provide the `xError` or `yError` in the [FlSpot](base_chart.md#FlSpot)).|[ErrorIndicatorData()](base_chart.md#FlErrorIndicatorData)|
65
62
63
+
### LineChartCurve
64
+
#### LineChartCubicTensionCurve
65
+
|PropName|Description|default value|
66
+
|:-------|:----------|:------------|
67
+
|smoothness| smoothness radius of the curve corners | 0.35|
68
+
|preventCurveOverShooting|prevent overshooting when draw curve line on linear sequence spots, check this [issue](https://github.com/imaNNeo/fl_chart/issues/25)| false|
69
+
|preventCurveOvershootingThreshold|threshold for applying prevent overshooting algorithm | 10.0|
70
+
71
+
#### LineChartCubicMonotoneCurve
72
+
|PropName|Description|default value|
73
+
|:-------|:----------|:------------|
74
+
|smooth| determines smoothness of the curve (0.0 = straight, 1.0 = roundest) | 0.5|
75
+
|monotone| monotonicity constraint (none, x, or y) to prevent overshooting along the specified axis | SmoothMonotone.none|
76
+
|tinyThresholdSquared| squared distance threshold to draw straight line when points are too close (avoids jitter) | 0.5|
0 commit comments