File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -61,17 +61,18 @@ class _MyAppState extends State<MyApp> {
6161 trendLineColor: Colors .blueGrey[200 ]! ,
6262 priceGridLineColor: Colors .blue[200 ]! ,
6363 priceLabelStyle: TextStyle (color: Colors .blue[200 ]),
64- timeLabelStyle: TextStyle (color: Colors .indigo ),
64+ timeLabelStyle: TextStyle (color: Colors .blue[ 200 ] ),
6565 selectionHighlightColor: Colors .red.withOpacity (0.2 ),
6666 overlayBackgroundColor: Colors .red[900 ]! .withOpacity (0.6 ),
6767 overlayTextStyle: TextStyle (color: Colors .red[100 ]),
68+ timeLabelHeight: 32 ,
6869 ),
6970 overlayInfo: (candle) => {
7071 "💎" : "🤚 " ,
7172 "高" : "${candle .high ?.toStringAsFixed (2 )}" ,
7273 "低" : "${candle .low ?.toStringAsFixed (2 )}" ,
7374 },
74- timeLabel: (timestamp, count) => "📅 " ,
75+ timeLabel: (timestamp, count) => "<Date> " ,
7576 priceLabel: (price) => "${price .round ()} 💎" ,
7677 ),
7778 ),
Original file line number Diff line number Diff line change @@ -68,7 +68,13 @@ class ChartPainter extends CustomPainter {
6868 )
6969 ..textDirection = TextDirection .ltr
7070 ..layout ();
71- timeTp.paint (canvas, Offset (x - timeTp.width / 2 , params.chartHeight));
71+
72+ // Align texts towards vertical bottom
73+ final topPadding = params.style.timeLabelHeight - timeTp.height;
74+ timeTp.paint (
75+ canvas,
76+ Offset (x - timeTp.width / 2 , params.chartHeight + topPadding),
77+ );
7278 }
7379 }
7480 }
You can’t perform that action at this time.
0 commit comments