مخطّطات

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" باسم متاح وجدول بيانات مخفي بصريًا، فيحصل مستخدم قارئ الشاشة على القيم الفعلية.

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