Dart Documentationorson_chartsStandardRectanglePainter

StandardRectanglePainter class

A rectangle painter that fills the background with a solid color.




new StandardRectanglePainter(Color color) #

Creates a new painter that will fill a rectangle with the specified color.

new StandardRectanglePainter.withImage(Color color, ImageElement image, Fit2D imageFit) #

Creates a new painter that will draw an image within the specified rectangle.


Color color #

The color (never null).

ImageElement image #

A background image for the chart, if any.

Fit2D imageFit #

Handles scaling of the image to fit the rectangle bounds.


void fill(CanvasRenderingContext2D context, Rectangle bounds) #

Fills the rectangle with the paint specified in the constructor.

Color getColor() #

Returns the color that will be used to fill rectangles.

ImageElement getImage() #

Returns the image.

Fit2D getImageFit() #

Returns the image fit specification.

@return The image fit specification.