ข้ามไปยังเนื้อหา

กราฟตราประทับ

SealChart

The signature chart: the university seal drawn from data. Twelve rays are the fiscal months, and the ring is the year's disbursement. Point at or focus a ray to read its month. Use it once per page, on a purple band.

กราฟเอกลักษณ์ของระบบ ตรามหาวิทยาลัยที่วาดจากข้อมูล รัศมี 12 แฉกคือ 12 เดือนของปีงบประมาณ และวงแหวนคือยอดเบิกจ่ายเทียบงบทั้งปี ใช้ไม่เกินหนึ่งครั้งต่อหน้า บนแถบสีม่วง เช่น หน้าแรก งานทั่วไปให้ใช้ LineChart หรือ BarChart ที่อ่านค่าได้ง่ายกว่า SealTotal และ SealMonthList ให้ข้อมูลเดียวกันเป็นข้อความ

import { SealChart, SealTotal, SealMonthList } from "@bsru/ui";

ตัวอย่าง

ปีงบประมาณ 2569

ชี้หรือกด Tab ไปที่รัศมีเพื่ออ่านยอดของเดือนนั้น max คือเดือนที่สูงสุดของทุกปีที่แสดง เพื่อให้รัศมีเทียบกันข้ามปีได้

90.0%เบิกจ่ายแล้วปีงบประมาณ 2569
<SealChart
  data={{
    year: 2569,
    budget: 72,
    months: [3.2, 3.8, 4.1, 5.2, 4.6, 5.9, 6.4, 5.1, 5.8, 6.7, 7.2, 6.8],
  }}
  max={7.2}
/>

ยอดรวมเทียบงบ

ยอดรวมของปีเทียบกับงบ เป็นข้อความหนึ่งบรรทัด

รวม 64.8 จากงบ 72.0 ล้านบาท

<SealTotal
  data={{
    year: 2569,
    budget: 72,
    months: [3.2, 3.8, 4.1, 5.2, 4.6, 5.9, 6.4, 5.1, 5.8, 6.7, 7.2, 6.8],
  }}
/>

ยอดรายเดือนเป็นรายการ

ให้ผู้ที่ไม่ได้ใช้เมาส์อ่านยอดทุกเดือนได้ วางไว้ใน details ข้างกราฟ

  • ต.ค.3.2
  • พ.ย.3.8
  • ธ.ค.4.1
  • ม.ค.5.2
  • ก.พ.4.6
  • มี.ค.5.9
  • เม.ย.6.4
  • พ.ค.5.1
  • มิ.ย.5.8
  • ก.ค.6.7
  • ส.ค.7.2
  • ก.ย.6.8
<SealMonthList
  data={{
    year: 2569,
    budget: 72,
    months: [3.2, 3.8, 4.1, 5.2, 4.6, 5.9, 6.4, 5.1, 5.8, 6.7, 7.2, 6.8],
  }}
/>

props ทั้งหมด

ตัวอย่างด้านบนใช้ props เพียงบางตัว ตารางนี้แสดงทุกตัวที่คอมโพเนนต์รับ พร้อมค่าเริ่มต้นและค่าที่ใช้ได้

SealChart

The signature chart: the university seal drawn from data. Twelve rays are the fiscal months, and the ring is the year's disbursement. Point at or focus a ray to read its month. Use it once per page, on a purple band.

SealChart props
ชื่อชนิดข้อมูลค่าเริ่มต้นคำอธิบาย
data* จำเป็นSealYear—The fiscal year to draw.
maxnumber—Longest month across the years shown, so rays compare between years.
classNamestring—Extra classes for the SVG, which always fills its width.

SealTotal

The year's total against its budget, as one line of text.

SealTotal props
ชื่อชนิดข้อมูลค่าเริ่มต้นคำอธิบาย
data* จำเป็นSealYear—The fiscal year to total.
classNamestring—Classes for the paragraph, such as its text colour.

SealMonthList

The seal chart's months as a list, for reading without pointing.

SealMonthList props
ชื่อชนิดข้อมูลค่าเริ่มต้นคำอธิบาย
data* จำเป็นSealYear—The fiscal year to list.
classNamestring—Classes for the list, such as a grid layout.

ชนิดข้อมูล

SealYear

One fiscal year for the seal chart, in million baht.

SealYear fields
ชื่อชนิดข้อมูลค่าเริ่มต้นคำอธิบาย
year* จำเป็นnumber—Buddhist-era fiscal year, such as 2569.
budget* จำเป็นnumber—The year's budget in million baht, for the ring and the total.
months* จำเป็นreadonly number[]—Twelve monthly figures in fiscal order, October first.

ข้อควรปฏิบัติ

  • months ต้องมี 12 ค่า เรียงตามปีงบประมาณ เริ่มที่ตุลาคม
  • ค่าทั้งหมดเป็นล้านบาท และ year เป็นปีพุทธศักราช
  • วางกราฟบนแถบสีม่วงเข้ม ตัวอักษรในกราฟเป็นสีขาว จึงอ่านไม่ออกบนพื้นขาว
  • รัศมีขึ้นทีละเดือนครั้งเดียวเมื่อเปิดหน้า เป็นการเคลื่อนไหวเดียวของหน้า จึงใช้กราฟนี้หน้าละครั้ง
  • หน้าที่มีกราฟต้องวาง <ChartPaints /> หนึ่งครั้ง ไม่เช่นนั้นรัศมีและวงแหวนจะไม่มีสี
  • ข้อมูลในตัวอย่างและการทดสอบต้องเป็นข้อมูลสมมติ

ซอร์สโค้ด: ui/src/charts/seal.tsx