Generates a linear bar geometry with the specified parameters.
Namespace: MindFusion.Gauges
File: GeometryFactory.js
JavaScript
![]() |
---|
function createLinearGeometry (centerX, centerY, startInnerOffset, startOuterOffset, endInnerOffset, endOuterOffset, length, isVertical, capStart, capEnd, strokeInner, strokeOuter) |
Type: Number
Number. The x-coordinate of the generated geometry.
Type: Number
Number. The y-coordinate of the generated geometry.
Type: Number
Number. The start inner offset of the generated geometry relative to the specified center.
Type: Number
Number. The start outer offset of the generated geometry relative to the specified center.
Type: Number
Number. The end inner offset of the generated geometry relative to the specified center.
Type: Number
Number. The end outer offset of the generated geometry relative to the specified center.
Type: Number
Number. The length of the generated geometry.
Type: Boolean
Boolean. A flag indicating whether the generated geometry is vertical.
Type: Boolean
Boolean. A flag indicating whether to draw a stroke at the start of the bar.
Type: Boolean
Boolean. A flag indicating whether to draw a stroke at the end of the bar.
Type: Boolean
Boolean. A flag indicating whether to draw a stroke at the inner side of the bar.
Type: Boolean
Boolean. A flag indicating whether to draw a stroke at the outer side of the bar.
A PathFigure representing a linear bar with the specified parameters.
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).