@@ -380,7 +380,8 @@ def DisplayLineGraph(self, x: int, y: int, width: int, height: int,
380380 axis_font : str = "./res/fonts/roboto/Roboto-Black.ttf" ,
381381 axis_font_size : int = 10 ,
382382 background_color : Color = (255 , 255 , 255 ),
383- background_image : Optional [str ] = None ):
383+ background_image : Optional [str ] = None ,
384+ axis_minmax_format : str = "{:0.0f}" ):
384385 # Generate a plot graph and display it
385386 # Provide the background image path to display plot graph with transparent background
386387
@@ -451,13 +452,13 @@ def DisplayLineGraph(self, x: int, y: int, width: int, height: int,
451452
452453 # Draw Legend
453454 draw .line ([0 , 0 , 1 , 0 ], fill = axis_color )
454- text = f" { int (max_value )} "
455+ text = axis_minmax_format . format (max_value )
455456 ttfont = self .open_font (axis_font , axis_font_size )
456457 _ , top , right , bottom = ttfont .getbbox (text )
457458 draw .text ((2 , 0 - top ), text ,
458459 font = ttfont , fill = axis_color )
459460
460- text = f" { int (min_value )} "
461+ text = axis_minmax_format . format (min_value )
461462 _ , top , right , bottom = ttfont .getbbox (text )
462463 draw .text ((width - 1 - right , height - 2 - bottom ), text ,
463464 font = ttfont , fill = axis_color )
0 commit comments