SparkPieChart: {
    data: number[] | {
        fillStyle: FillStyle;
        value: number;
    }[];
    strokeStyle?: LineStyle;
    type: "spark-pie";
}

Description of a Spark Pie Chart.

Displays a miniature pie chart.

Can be used with DataGrid.

 // Example, spark pie chart in a DataGrid
DataGrid.setCellContent(0, 0, {
type: 'spark-pie',
data: [0, 10, 6, 4, 9, 8, 3, 6]
})

Alternatively, each slice can be assigned an individual fill style:

 // Example, spark pie chart in a DataGrid
DataGrid.setCellContent(0, 0, {
type: 'spark-pie',
data: [
{ value: 5, fillStyle: new SolidFill({ color: ColorCSS('red') }) },
{ value: 8, fillStyle: new SolidFill({ color: ColorCSS('green') }) },
{ value: 3, fillStyle: new SolidFill({ color: ColorCSS('blue') }) },
]
})

Type declaration

  • data: number[] | {
        fillStyle: FillStyle;
        value: number;
    }[]

    Data for pie slices as either list of numbers or list of numbers and fill styles.

     // Example, all slices same style
    data: [0, 10, 6, 4, 9, 8, 3, 6]
     // Example, individual styles
    data: [
    { value: 5, fillStyle: new SolidFill({ color: ColorCSS('red') }) },
    { value: 8, fillStyle: new SolidFill({ color: ColorCSS('green') }) },
    { value: 3, fillStyle: new SolidFill({ color: ColorCSS('blue') }) },
    ]
  • Optional strokeStyle?: LineStyle

    Optional stroke style for slices.

  • type: "spark-pie"

    Identifier that is used to select the spark chart type.