Page MenuHomePhorge

How to set fa-pie-chart value?
OpenPublic

Asked by littleggghost on Mar 1 2024, 16:38.

Details

As ponder Q114: Subtypes deadline switch to colored calendar icons says, I want to replace the calendar icon to a pie-char percentage icon.

In the extension codes about the icon value part:

if ($deadline && $due) {
  $text = phabricator_date($due, $viewer);
  $now = time();
  $day = 86400;
  if ($due < $now) {
    $this->setColor('fire');
  } else if ($due < $now + ($day * 2.5)) {
    $this->setColor('orange');
  } else if ($due < $now + ($day * 7)) {
    $this->setColor('green');
  } else {
    $this->setColor('grey');
  }
  $icon = 'fa-calendar-check-o';
}

The variable "text" and function "setColor" is the key to set a colored calendar with date.

Then what's the key variable and function about a pie-chart? Could you give me a short demo about a simple pie-chart?

Thanks!

Answers

20after4
Updated 256 Days Ago

fa-pie-chart is a pie chart icon:

there aren't separate versions for different percentages, unfortunately.

You could maybe use Unicode characters like U+25D5 CIRCLE WITH ALL BUT UPPER LEFT QUADRANT BLACK

Examples: ◴ ◵ ◶ ◷ ◐ ◑ ◒ ◓ ◕

New Answer