Style class for describing a solid line.

Instances of SolidLine, like all LCJS style classes, are immutable, meaning that its setters don't modify the actual object, but instead return a completely new modified object.

Properties of SolidLine:

  • thickness: thickness of line as pixels.
  • fillStyle: description of line fill color. The supported fillStyles vary per component.

SolidLine Usage:

Use SolidLine with:

Watch out! A common misuse is to attempt styling strokes or borders directly using fill style or color. Remember, when calling a setStrokeStyle method, a line style is expected! Carefully observe the order of wrapped styles: line style <- fill style <- color

 // Example, set line series stroke style to 1px solid red.
LineSeries.setStrokeStyle(new SolidLine({
thickness: 1,
fillStyle: new SolidFill({ color: ColorRGBA( 255, 0, 0 ) })
}))

Related information:

For more line styles, see:

Type Parameters

Hierarchy

  • SolidLineStyleRecord
    • SolidLine

Implements

Constructors

  • Construct a SolidLine object, specifying any amount of its properties.

     // Example, 1px solid red line.
    const solidRed = new SolidLine({
    thickness: 1,
    fillStyle: new SolidFill({ color: ColorRGBA( 255, 0, 0 ) })
    })

    LineSeries.setStrokeStyle(solidRed)

    Type Parameters

    Parameters

    Returns SolidLine<FillType>

Properties

fillStyle: FillStyle

Line fill style.

lineType: "solid" = 'solid'
thickness: number

Line thickness.

-1 can be used to signify smallest available thickness. With most features, this will result in slightly better GPU performance, but less detailed line.

Default value: 1.

type: "linestyle" = 'linestyle'

Methods

  • Get fill style of SolidLine.

    Returns

    SolidFill object

    Returns FillType

  • Get thickness of SolidLine

    Returns

    Thickness as pixels

    Returns number

  • Construct a new Visible line object based on this one, but with modified fill style.

    Example (SolidFill):

    // specify new fillstyle
    solidLineStyle.setFillStyle( new SolidFill({
    color: ColorHex('#F00')
    }) )
    // change fillstyle properties
    solidLineStyle.setFillStyle(
    solidfill => solidfill.setA( 80 )
    )

    Returns

    New SolidLine object

    Type Parameters

    Parameters

    • value: NewFillType | ImmutableMutator<FillType, NewFillType>

      Either a SolidFill object or a function, which will be used to create a new VisibleFill based on current value.

    Returns SolidLine<NewFillType>

  • Construct a new SolidLine object based on this one, but with modified thickness.

    -1 can be used to signify smallest available thickness. With most features, this will result in slightly better GPU performance, but less detailed line.

    Parameters

    Returns SolidLine<FillType>