Dart Documentationorson_chartsChart3D

Chart3D class

The top-level chart object, manages the title, subtitle, legend generator and Plot3D instance.

The chart implements a listener mechanism to notify listeners whenever a change is made to the chart, its subelements or its dataset. For any change, a Chart3DChangeEvent is sent to all registered listeners.

Implements

Plot3DChangeListener, ChartStyleChangeListener, Drawable3D, ChartElement

Static Properties

final DEFAULT_CHART_BOX_COLOR #

The default chart box color.

final DEFAULT_FONT_FAMILY_STR #

The default font family for text elements in charts.

final DEFAULT_SUBTITLE_FONT #

The default subtitle font.

final DEFAULT_TITLE_FONT #

The default title font.

Constructors

new Chart3D(String title, String subtitle, Plot3D plot) #

Creates a new chart instance with the specified title, subtitle and plot. It is the plot that controls most of the visual aspects of the chart.

The title and subtitle can be null.

Properties

RectanglePainter get background #

Returns the object responsible for painting the background area for the chart.

void set background(RectanglePainter backgroundPainter) #

Sets the background painter and sends a Chart3DChangeEvent to all registered listeners.

Color get chartBoxColor #

Returns the chartbox color (the chartbox draws the "walls" in the background of the plot). The default value is [DEFAULT_CHART_BOX_COLOR].

There is no chartbox drawn for pie charts.

void set chartBoxColor(Color color) #

Sets the chartbox color and sends a Chart3DChangeEvent to all registered listeners.

final Dimension3D dimensions #

Returns the dimensions of the chart (the same as the dimensions of the plot belonging to the chart).

Anchor2D get legendAnchor #

Returns the anchor point for the chart legend.

void set legendAnchor(Anchor2D anchor) #

Sets the anchor point for the chart legend and sensd a Chart3DChangeEvent to all registered listeners.

LegendBuilder get legendBuilder #

Returns the legend builder for the chart.

void set legendBuilder(LegendBuilder builder) #

Sets the legend builder for the chart and sends a change event to all registered listeners.

Orientation get legendOrientation #

Returns the legend orientation. The default is HORIZONTAL.

void set legendOrientation(Orientation orientation) #

Sets the legend orientation and sends a change event to all registered listeners.

num get margin #

Returns the margin. The default value is 0.25 (25 percent).

void set margin(num margin) #

Sets the margin used when auto-zooming the content to fit the current rendering bounds and sends a change event to all registered listeners.

bool get notify #

Returns the flag that controls whether or not change events are sent to registered listeners. You can set this to false temporarily if you have a lot of changes to make to a chart and you don't want to trigger chart repaints until you are finished.

void set notify(bool notify) #

Sets the flag that controls whether or not change events are sent to registered listeners. If notify is true, this method will generate a change notification based on the assumption that there have been accumulated chart changes while the flag was set to false.

Plot3D plot #

num projDist #

Returns the projection distance.

docs inherited from Drawable3D

ChartStyle style #

final TableElement title #

Anchor2D get titleAnchor #

Returns the anchor point for the chart title (and subtitle if there is one).

void set titleAnchor(Anchor2D anchor) #

Sets the anchor point for the chart title and sends a change event to all registered listeners.

Offset2D translate2D #

Returns the offset from the center of the bounds for the rendering.

docs inherited from Drawable3D

ViewPoint3D viewPoint #

Returns the current viewing point.

docs inherited from Drawable3D

Methods

Rectangle calculateDrawArea(Dimension2D dim, Anchor2D anchor, Rectangle bounds) #

void chartStyleChanged(ChartStyleChangeEvent event) #

World createWorld(ChartBox3D chartBox) #

void draw(CanvasRenderingContext2D context, Rectangle bounds) #

Renders the chart within the specified bounds of the canvas.

void drawAxes(CanvasRenderingContext2D context, ChartBox3D chartBox, List<Point> pts) #

Draws the axis to the given context. The chartBox contains vertices that determine the end points of the axes, as well as anchor vertices for the tick labels that will be overlaid on the chart after the 3D objects are rendered. The pts list contains the projected points for all the vertices of all the objects that make up the chart.

This method is called internally, you won't normally call it directly.

void drawGridlines(CanvasRenderingContext2D context, CBFace face, List<Point> pts) #

void drawPieLabels(CanvasRenderingContext2D context, num w, num h, num depth) #

Color fetchGridlineColorX(Plot3D plot) #

Returns the color for the gridlines for the x-axis, or null.

Color fetchGridlineColorY(Plot3D plot) #

Returns the color for the gridlines for the y-axis, or null.

Color fetchGridlineColorZ(Plot3D plot) #

Returns the color for the gridlines for the z-axis, or null.

Stroke fetchGridlineStrokeX(Plot3D plot) #

Stroke fetchGridlineStrokeY(Plot3D plot) #

Stroke fetchGridlineStrokeZ(Plot3D plot) #

List<TickData> fetchXTickData(Plot3D plot, num tickUnit) #

List<TickData> fetchYTickData(Plot3D plot, num tickUnit) #

List<TickData> fetchZTickData(Plot3D plot, num tickUnit) #

List<num> findAxisTickUnits(CanvasRenderingContext2D context, num w, num h, num depth) #

bool isGridlinesVisibleForX(Plot3D plot) #

Returns true if gridlines are visible for the x-axis and false otherwise.

bool isGridlinesVisibleForY(Plot3D plot) #

Returns true if gridlines are visible for the y-axis and false otherwise.

bool isGridlinesVisibleForZ(Plot3D plot) #

Returns true if gridlines are visible for the z-axis and false otherwise.

bool longest(num x, num a, num b, num c) #

void plot3DChanged(Plot3DChangeEvent) #

Receives notification of a change to the chart's plot or the plot's subelements.

void populateAnchorPoints(List<TickData> tickData, List<Point> pts) #

void receive(ChartElementVisitor visitor) #

Receives a visitor - the visitor's visit() method will be called for each ChartElement within this chart structure.

void zoomToFit(Dimension2D size) #

Modifies the viewing distance so that the chart fits within the specified dimension (this does not take into account labels).