Skip to content

ChartCanvas Positioning #3

Closed
Closed
@Peetzn

Description

@Peetzn

The layout X and Y of the ChartCanvas are set to the X and Y values of the ChartViewer in its layoutChildren method. The works well only if the ChartViewer is placed at the point of origin (x=0 and y=0) in its surrounding container. Otherwise the ChartCanvas will be placed outside of the ChartViewer.
The layout x and y position the node inside its parent. Therefore the ChartCanvas is placed inside the Chartviewer exactly as the ChartViewer is placed in its parent node which means that the Canvas will be plaxed at X2 and Y2 in the parent node.

See javadoc of Node:

Each Node also has a read-only boundsInParent variable which specifies the bounding rectangle of the Node after all transformations have been applied, including those set in transforms, scaleX/scaleY, rotate, translateX/translateY, and layoutX/layoutY. It is called "boundsInParent" because the rectangle will be relative to the parent's coordinate system. This is the 'visual' bounds of the node. <

Example for reproduction:
Placing multiple Charts in a VBox (or HBox) will illustrate the problem pretty well, for the coordinates add up for each chart and the gaps are getting bigger.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions