838
Committed by David PHAM-VAN

Add options to customise border in Dataset widget

... ... @@ -8,6 +8,7 @@
- Fix unit tests
- Update Image dependency
- Fix lints
- Add options to customise border in Dataset widget [838]
## 3.8.4
... ...
... ... @@ -27,8 +27,8 @@ class BarDataSet<T extends PointChartValue> extends PointDataSet<T> {
BarDataSet({
required List<T> data,
String? legend,
this.borderColor,
this.borderWidth = 1.5,
PdfColor? borderColor,
double borderWidth = 1.5,
PdfColor color = PdfColors.blue,
bool? drawBorder,
this.drawSurface = true,
... ... @@ -54,11 +54,11 @@ class BarDataSet<T extends PointChartValue> extends PointDataSet<T> {
pointSize: pointSize,
shape: shape,
valuePosition: valuePosition,
borderColor: borderColor,
borderWidth: borderWidth,
);
final bool drawBorder;
final PdfColor? borderColor;
final double borderWidth;
final bool drawSurface;
... ...
... ... @@ -152,12 +152,18 @@ abstract class Dataset extends Widget {
Dataset({
this.legend,
this.color,
this.borderColor,
this.borderWidth = .5,
});
final String? legend;
final PdfColor? color;
final PdfColor? borderColor;
final double borderWidth;
void paintBackground(Context context) {}
void paintForeground(Context context) {}
... ... @@ -167,8 +173,8 @@ abstract class Dataset extends Widget {
decoration: BoxDecoration(
color: color,
border: Border.all(
color: PdfColors.black,
width: .5,
color: borderColor ?? PdfColors.black,
width: borderWidth,
),
),
);
... ...
... ... @@ -118,8 +118,8 @@ class PieDataSet extends Dataset {
required this.value,
String? legend,
required PdfColor color,
this.borderColor = PdfColors.white,
this.borderWidth = 1.5,
PdfColor? borderColor = PdfColors.white,
double borderWidth = 1.5,
bool? drawBorder,
this.drawSurface = true,
this.surfaceOpacity = 1,
... ... @@ -142,6 +142,8 @@ class PieDataSet extends Dataset {
super(
legend: legend,
color: color,
borderColor: borderColor,
borderWidth: borderWidth,
);
final num value;
... ... @@ -151,8 +153,6 @@ class PieDataSet extends Dataset {
late double angleEnd;
final bool drawBorder;
final PdfColor? borderColor;
final double borderWidth;
final bool drawSurface;
... ...
... ... @@ -37,6 +37,8 @@ class PointDataSet<T extends PointChartValue> extends Dataset {
String? legend,
this.pointSize = 3,
PdfColor color = PdfColors.blue,
PdfColor? borderColor,
double borderWidth = 1.5,
this.drawPoints = true,
this.shape,
this.buildValue,
... ... @@ -44,6 +46,8 @@ class PointDataSet<T extends PointChartValue> extends Dataset {
}) : super(
legend: legend,
color: color,
borderColor: borderColor,
borderWidth: borderWidth,
);
final List<T> data;
... ...