Package org.patternfly.chart.pie


package org.patternfly.chart.pie
Provides the PatternFly pie chart component for displaying proportional data as a circle.

Pie charts display data as segments of a circle. They support legends, theme colors, custom color scales, and configurable padding.

Usage

Use the Pie.pie() factory method to create a pie chart:
import static org.patternfly.chart.Data.data;
import static org.patternfly.chart.LegendOrientation.vertical;
import static org.patternfly.chart.LegendPosition.right;
import static org.patternfly.chart.Padding.padding;
import static org.patternfly.chart.pie.Pie.pie;

Pie chart = pie()
        .title("100")
        .subTitle("Pets")
        .ariaTitle("Pie chart example")
        .ariaDesc("Average number of pets")
        .data(data("Cats", 35), data("Dogs", 55), data("Birds", 10))
        .labels(data -> data.x + ": " + data.y + "%")
        .legendData("Cats: 35", "Dogs: 55", "Birds: 10")
        .legendPosition(right)
        .legendOrientation(vertical)
        .padding(padding(20, 140, 20, 20))
        .width(350)
        .height(230);
See Also:
  • Classes
    Class
    Description