DB1
DB2
lets(
/* 當月收入加總 */
Jan, prop("今年資料").filter(current.prop("月份") == "Jan").map(current.prop("總價")).sum(),
Feb, prop("今年資料").filter(current.prop("月份") == "Feb").map(current.prop("總價")).sum(),
Mar, prop("今年資料").filter(current.prop("月份") == "Mar").map(current.prop("總價")).sum(),
Apr, prop("今年資料").filter(current.prop("月份") == "Apr").map(current.prop("總價")).sum(),
May, prop("今年資料").filter(current.prop("月份") == "May").map(current.prop("總價")).sum(),
Jun, prop("今年資料").filter(current.prop("月份") == "Jun").map(current.prop("總價")).sum(),
Jul, prop("今年資料").filter(current.prop("月份") == "Jul").map(current.prop("總價")).sum(),
Aug, prop("今年資料").filter(current.prop("月份") == "Aug").map(current.prop("總價")).sum(),
Sep, prop("今年資料").filter(current.prop("月份") == "Sep").map(current.prop("總價")).sum(),
Oct, prop("今年資料").filter(current.prop("月份") == "Oct").map(current.prop("總價")).sum(),
Nov, prop("今年資料").filter(current.prop("月份") == "Nov").map(current.prop("總價")).sum(),
Dec, prop("今年資料").filter(current.prop("月份") == "Dec").map(current.prop("總價")).sum(),
/* Format */
list, [Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec],
titles, ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
/* Values */
最大值, list.max(),
/* Progress bars */
顏色, "orange",
樣式一, ["c", "b", 顏色],
設計, "⬜🟨",
list.map(
titles.at(index).style(樣式一) + ": " + style("■", "b", 顏色) +
ifs(
current.length() <= 6,
current.style(樣式一) +
style(" ".repeat(6 - current.length()), 樣式一)
) + " | ".style(樣式一) + " " +
設計.substring(1).repeat((current / 最大值 * 12).ceil()) +
設計.substring(0, 1).repeat(12 - (current / 最大值 * 12).ceil())).join("\\n")
)