Appearance of SfPyramid Charts
Chart sizing
Chart renders based on the parent widget size. If you need the chart to be rendered in specific size, then set the size(width/height) to the parent widget.
@override
Widget build(BuildContext context) {
return Scaffold(
body: SafeArea(
child: Center(
child: Container(
height: 300,
width: 350,
child: SfPyramidChart()
)
)
)
);
}
Chart margin
Margin to the chart can be specified using the margin
property.
@override
Widget build(BuildContext context) {
return Scaffold(
body: SafeArea(
child: Center(
child: Container(
height: 300,
width: 350,
child: SfPyramidChart(
borderColor: Colors.red,
borderWidth: 2,
// Sets 15 logical pixels as margin for all the 4 sides.
margin: EdgeInsets.all(15)
)
)
)
)
);
}
Chart area customization
You can customize the Area of the chart using the below properties.
-
backgroundColor
– used to change the Chart area background color. -
backgroundImage
- used to set the image path.
@override
Widget build(BuildContext context) {
return Scaffold(
body: SafeArea(
child: Center(
child: Container(
height: 300,
width: 350,
child: SfPyramidChart(
backgroundColor: Colors.lightGreen,
backgroundImage: 'images/livechart.png',
)
)
)
)
);
}
Was this page helpful?
Yes
No
Thank you for your feedback!
Thank you for your feedback and comments. We will rectify this as soon as possible!
An unknown error has occurred. Please try again.
Help us improve this page