Articles in this section
Category / Section

How to render the Cartesian chart (SfCartesianChart) with background image for plot area?

1 min 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.

Folder structure

 

Step 2: Then add the asset section in the pubspec.yaml file.

Asset section

 

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 

 

plotArea

 

View the sample in GitHub

 

 

 

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied