Coordinate
F2 supports two kinds of coordinates, Cartesian coordinate and polar coordinate. Cartesian coordinate is used by default.
Configuration
Cartesian Coordinate
Polar Coordinate
Get Coordinate Instance
The method will return the coordinate instance of current chart. Different coordinate types contain different properties.
Cartesian Coordinate
If it is a cartesian coordinate instance, it will contain the following properties:
Name
Type
Description
start
Object
The starting point of the coordinate in canvas, the origin of the coordinate in F2 chart is located in the lower left corner. The value is like { x: 10, y: 10 }
end
Object
The position of upper right corner of the coordinate system in canvas. The value is like { x: 100, y: 100 }
transposed
Boolean
Wether the coordinate is transposed, true means it is transposed.
isRect
Boolean
Indicating that it is a Cartesian coordinate.
Polar Coordinate
If it is a polar coordinate instance, it will contain the following properties:
Name
Type
Description
startAngle
Number
The starting angle of polar coordinate
endAngle
Number
The ending angle of polar coordinate
innerRadius
Number
The internal hollow radius when a ring is drawn, relative value, range of [0, 1]
radius
Number
The radius of the circle, relative value, range of [0, 1]
isPolar
Boolean
Wether it is a polar coordinate, true if it is
transposed
Boolean
Wether it is transposed, true means it is
center
Object
The canvas coordinates of the center of the polar coordinates
circleRadius
Number
radius of the polar coordinate
Demos
Donut Chart
Draw a semicircle pie chart
Last updated