Search
GeometryFactory.createLinearGeometry Method
See Also
 






Generates a linear bar geometry with the specified parameters.

Namespace: MindFusion.Gauges
File: GeometryFactory.js

 Syntax

JavaScript  Copy Code

function createLinearGeometry (centerX, centerY, startInnerOffset, startOuterOffset, endInnerOffset, endOuterOffset, length, isVertical, capStart, capEnd, strokeInner, strokeOuter)

 Parameters

centerX

Number. The x-coordinate of the generated geometry.

centerY

Number. The y-coordinate of the generated geometry.

startInnerOffset

Number. The start inner offset of the generated geometry relative to the specified center.

startOuterOffset

Number. The start outer offset of the generated geometry relative to the specified center.

endInnerOffset

Number. The end inner offset of the generated geometry relative to the specified center.

endOuterOffset

Number. The end outer offset of the generated geometry relative to the specified center.

length

Number. The length of the generated geometry.

isVertical

Boolean. A flag indicating whether the generated geometry is vertical.

capStart

Boolean. A flag indicating whether to draw a stroke at the start of the bar.

capEnd

Boolean. A flag indicating whether to draw a stroke at the end of the bar.

strokeInner

Boolean. A flag indicating whether to draw a stroke at the inner side of the bar.

strokeOuter

Boolean. A flag indicating whether to draw a stroke at the outer side of the bar.

 Return Value

A PathFigure representing a linear bar with the specified parameters.

 Remarks

The generated geometry is a trapezium.For example, a vertical linear geometry with centerX = 10, centerY = 10,startInnerOffset = 0, startOuterOffset = 5, endInnerOffset = 0, endOuerOffset = 10,length = 100; will be a trapezium with points (10, 110), (15, 110), (20, 10), (10, 10).A horizontal lienar geometry with the above parameters will be a trapeziumwith points (10, 10), (10, 15), (110, 20), (110, 10).

 See Also