Category / Section
How to render the Cartesian chart (SfCartesianChart) with background image for plot area?
4 mins read
Description
This article describes how to render the chart with background image for plot area
Solution
Flutter chart widget provides support for rendering the background image for the plot area. You can set the desired image as a background for the plot area using the plotAreaBackgroundImage property.
The following steps describe step by step procedure for adding image to plot area of chart widget.
Step 1: Create a folder named images in your application and copy the desired image.
Step 2: Then add the asset section in the pubspec.yaml file.
Step 3: Now, add the image to the plotAreaBackgroundImage property from the images folder.
@override Widget build(BuildContext context) { return Scaffold( body: SfCartesianChart( plotAreaBackgroundImage:const AssetImage('images/texture.jpg'), // Other configurations ) ); }
Screenshot