مخططات

Charts

مخططات بيانية SVG في React بلا اعتماديات، تستخدم لوحة ألوان الهيئة الفئوية: BarChart، LineChart، وPieChart. لكل مخطط جدول بديل متاح الوصول ودعم للاتجاه العربي.

تتشارك المخططات الثلاثة واجهة واحدة: مرر data للمخطط الدائري، أو series مع categories لمخطط الأعمدة والخطوط. يعرض كل مخطط جدول بيانات بديلاً لتسهيل الوصول.

متى تستخدمه

استخدم BarChart لمقارنة الفئات، LineChart لتتبع التغير عبر الزمن، وPieChart لعرض حصص قليلة من مجموع واحد. مرر series وcategories لمخطط الأعمدة والخطوط، أو data للمخطط الدائري.

أبق عدد السلاسل قليلاً لتبقى الألوان الفئوية متمايزة. لرقم رئيسي واحد، استخدم Metric.

أمثلة

مخطط أعمدة

مخطط خطي

مخطط دائري

الخصائص

الخصائص التي يعرفها Charts. سمات العنصر الأصلي تمر كما هي.

<BarChart>

الخاصيةالنوعالافتراضيالوصف
palettePaletteColour set: DGA categorical (default) or the monochrome brand-green sequence.
legendbooleantrueShow the legend.
titlestringAccessible name for the chart (also the data-table caption).
seriesإلزاميChartSeries[]
categoriesإلزاميstring[]
xAxisLabelstringX-axis title.
yAxisLabelstringY-axis title (rotated).
yMaxnumberForce the Y-axis maximum (default: auto, rounded to a nice value).
widthnumberviewBox width / height. Charts scale responsively to their container.
heightnumber
stackedbooleanStack series into one column per category (default). false groups them side by side.

<LineChart>

الخاصيةالنوعالافتراضيالوصف
palettePaletteColour set: DGA categorical (default) or the monochrome brand-green sequence.
legendbooleantrueShow the legend.
titlestringAccessible name for the chart (also the data-table caption).
seriesإلزاميChartSeries[]
categoriesإلزاميstring[]
xAxisLabelstringX-axis title.
yAxisLabelstringY-axis title (rotated).
yMaxnumberForce the Y-axis maximum (default: auto, rounded to a nice value).
widthnumberviewBox width / height. Charts scale responsively to their container.
heightnumber
areabooleantrueDraw a soft area gradient under each line.
curve"linear" | "smooth"A smooth Catmull-Rom curve (SDGA "Gradual" default) or straight segments.

<PieChart>

الخاصيةالنوعالافتراضيالوصف
palettePaletteColour set: DGA categorical (default) or the monochrome brand-green sequence.
legendbooleantrueShow the legend.
titlestringAccessible name for the chart (also the data-table caption).
dataإلزاميChartSlice[]
donutbooleanRender a donut (50% hole) instead of a full pie.
sizenumber240Disk diameter in px.

إمكانية الوصول

يعرض كل مخطط role="img" مع اسم متاح الوصول وجدول بيانات مخفي بصرياً، مما يتيح لمستخدمي قارئات الشاشة الوصول إلى القيم الفعلية.

تأتي الألوان من مقياس الهيئة الفئوي، وتستخدم مفاتيح المخطط تسميات نصية إلى جانب اللون. تتبع المحاور والتسميات اتجاه الصفحة في العربية.