Package org.patternfly.chart.utilization


package org.patternfly.chart.utilization
Provides the PatternFly donut utilization and donut threshold chart components for displaying capacity and usage data.

Donut utilization charts show a single data value as a percentage of a whole, commonly used for resource usage such as storage capacity, memory, or CPU. Donut threshold charts add warning and danger threshold levels that change the chart color based on the current value.

Donut Utilization

Use the DonutUtilization.donutUtilization() factory method to create a utilization chart:
import static org.patternfly.chart.Data.data;
import static org.patternfly.chart.utilization.DonutUtilization.donutUtilization;

DonutUtilization chart = donutUtilization()
        .title("75%")
        .subTitle("of 100 GBps")
        .ariaTitle("Donut utilization chart example")
        .ariaDesc("Storage capacity")
        .data(data("Storage capacity", 75))
        .thresholds(60, 90)
        .labels(data -> data.x != null ? data.x + ": " + data.y + "%" : null);

Donut Threshold

Use the DonutThreshold.donutThreshold() factory method to create a threshold chart that can be combined with a utilization chart:
import static org.patternfly.chart.utilization.DonutThreshold.donutThreshold;

DonutThreshold threshold = donutThreshold()
        .ariaTitle("Donut threshold chart example")
        .ariaDesc("Storage capacity thresholds");
See Also: