JavaScript Pie Chart with Lookup table - Editor

Lookup table stores information about values and its associated colors. It provides efficient lookup of the color based on provided value as well as linear and step interpolation between colors.

The current example shows usage of lookup table with a Pie Chart.

// create LUT from 0..120 with gradient steps.
const lut = new LUT( {
    steps: [
        { value: 20, color: ColorRGBA( 255, 0, 24 ) },
        { value: 40, color: ColorRGBA( 255, 165, 44 ) },
        { value: 60, color: ColorRGBA( 255, 255, 65 ) },
        { value: 80, color: ColorRGBA( 0, 128, 24 ) },
        { value: 100, color: ColorRGBA( 0, 0, 249 ) },
        { value: 120, color: ColorRGBA( 134, 0, 125 ) }
    ],
    interpolate: true
}

Create a Pie Chart and attach lookup table to fill the slices with colors based on value.

// Create a new Pie Chart
const chart = lightningChart()
    .Pie({ type: PieChartTypes.LabelsOnSides })
    .setAnimationsEnabled(true)
    .setMultipleSliceExplosion(true)
    .setLabelFormatter(SliceLabelFormatters.NamePlusValue)
    .setSliceSorter(SliceSorters.None)
    // Attach lookup table.
    .setLUT(lut)
    .setLabelConnectorGap(10)