🎯Target Donut Plot Row

Introduction

This is a target donut plot that generally shows a target value and how much of that is achieved. It takes both the target and achieved values as input and visualizes them through a donut plot. It also shows a legend beside the main plot, hence the name, Target Donut Plot Row.

Target Donut Plot

Code Example

To create a target donut plot, we need to pass in the pair of achieved and target values, similar to Donut Plot Row charts.

Example of a target row donut plot :-

// This is the percentage achieved.
val percentage = DecimalFormat("#.##").format(achieved / target * 100)

// This function creates the plot.
DonutRowChartStrategy.TargetDonutPlotRow(
    circularData = dataSet,
    circularCenter = TextCenterStrategy(
        text = "$percentage %" // Text to be shown in the middle of the plot
    )
)

Last updated

Was this helpful?