Skip to content

Commit d8468ad

Browse files
committed
Mask the graph labels with black so the milestone lines don't interfere.
1 parent 78698e6 commit d8468ad

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/layered_chart.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ class ChartPainter extends CustomPainter {
159159
Paint textPaint;
160160
Paint milestonePaint;
161161
Paint linePaint;
162+
Paint fillPaint;
162163

163164
LayeredChartState state;
164165

@@ -178,6 +179,9 @@ class ChartPainter extends CustomPainter {
178179
linePaint = new Paint();
179180
linePaint.style = PaintingStyle.stroke;
180181
linePaint.strokeWidth = 0.5;
182+
fillPaint = new Paint();
183+
fillPaint.style = PaintingStyle.fill;
184+
fillPaint.color = new Color(0xFF000000);
181185
}
182186

183187
@override
@@ -268,6 +272,7 @@ class ChartPainter extends CustomPainter {
268272
// canvas.translate(startX + 25, startY - 2);
269273
canvas.skew(0 * pi / 180, -theta);
270274
TextPainter tp = state.labelPainter[i];
275+
canvas.drawRect(new Rect.fromLTWH(-2, -2, tp.width + 4, tp.height + 4), fillPaint);
271276
tp.paint(canvas, new Offset(0, 0));
272277
canvas.restore();
273278
}

0 commit comments

Comments
 (0)