juan_gandhi: (VP)
[personal profile] juan_gandhi
from VERY expensive contractors


lazy val chartData = JArray(List(
("label" -> "Enabled") ~ ("data" -> enabled) ~ ("color" -> "#78c063"),
("label" -> "Not Enabled") ~ ("data" -> (total - enabled)) ~ ("color" -> "#f7d975")))

def render: CssSel =
".cname" #> name.getOrElse("") &
".total [href]" #> link &
".count-total *" #> total &
".count-enabled *" #> enabled &
".count-active *" #> active &
".count-not-enabled *" #> (total - enabled) &
".count-not-active *" #> (total - active) &
".enabled-pc *" #> asPercent(enabled.toDouble / total.toDouble) &
".chart-data" #> <lift:tail>{ Script(JsCrVar("clients_enabled", chartData) & OnLoad(Run("""$.plot($("#clients-enabled-chart"), clients_enabled, donut_options)"""))) }</lift:tail>

}

Date: 2015-11-11 08:40 am (UTC)
From: [identity profile] zeit-raffer.livejournal.com
Результат делаем в виде свободной монады, а потом ее интерпретируем в XML?
Включая имена цветов.
Edited Date: 2015-11-11 08:41 am (UTC)

Date: 2015-11-11 03:06 pm (UTC)
From: [identity profile] juan-gandhi.livejournal.com
Цвета вообще должны быть вынесены в стили, понятное дело. Представьте, менять skin для разных партнеров.
Edited Date: 2015-11-11 03:07 pm (UTC)

Profile

juan_gandhi: (Default)
Juan-Carlos Gandhi

June 2025

S M T W T F S
1 2345 6 7
8 9 10 11 121314
15161718 1920 21
222324252627 28
29 30     

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jul. 2nd, 2025 01:50 pm
Powered by Dreamwidth Studios