Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion skills/igniteui-react-components/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ This skill is organized into focused reference files. Load the appropriate file
| Event Handling | [EVENT-HANDLING.md](./reference/EVENT-HANDLING.md) | Event props, CustomEvent types, common events |
| Refs & Forms | [REFS-FORMS.md](./reference/REFS-FORMS.md) | useRef, controlled/uncontrolled forms, React Hook Form |
| Charts, Gauges, Maps & Grid Lite | [CHARTS-GRIDS.md](./reference/CHARTS-GRIDS.md) | Module registration, container sizing |
| Reveal SDK | [REVEAL-SDK.md](./reference/REVEAL-SDK.md) | Embedded BI dashboards, theme sync |
| Troubleshooting | [TROUBLESHOOTING.md](./reference/TROUBLESHOOTING.md) | Common issues and solutions |

---
Expand Down
217 changes: 217 additions & 0 deletions skills/igniteui-react-components/reference/CHARTS-GRIDS.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ IgrCategoryChartModule.register();
| Component | Module Import | Registration |
|---|---|---|
| `IgrCategoryChart` | `IgrCategoryChartModule` | `IgrCategoryChartModule.register()` |
| `IgrDataChart` | `IgrDataChartCoreModule` + category/annotation modules (see [Complete Data Chart Example](#complete-data-chart-example)) | Multiple `.register()` calls required |
| `IgrPieChart` | `IgrPieChartModule` | `IgrPieChartModule.register()` |
| `IgrFinancialChart` | `IgrFinancialChartModule` | `IgrFinancialChartModule.register()` |
| `IgrRadialGauge` | `IgrRadialGaugeModule` | `IgrRadialGaugeModule.register()` |
Expand Down Expand Up @@ -90,6 +91,222 @@ export default function DashboardView() {
}
```

## Complete Data Chart Example

> **⚠️ IMPORTANT:** `IgrDataChart` requires registering **multiple modules** depending on the series type used. For bar charts, register the modules shown below. If you miss any module, the chart or axis types will silently fail to render.

### Module Registration for Bar Charts

```tsx
import {
IgrLegendModule,
IgrDataChartCoreModule,
IgrDataChartCategoryCoreModule,
IgrDataChartCategoryModule,
IgrDataChartInteractivityModule,
IgrDataChartVerticalCategoryModule,
IgrDataChartAnnotationModule,
} from 'igniteui-react-charts';

// Register all required modules once at module level (outside any component)
IgrLegendModule.register();
IgrDataChartCoreModule.register();
IgrDataChartCategoryCoreModule.register();
IgrDataChartCategoryModule.register();
IgrDataChartInteractivityModule.register();
IgrDataChartVerticalCategoryModule.register();
IgrDataChartAnnotationModule.register();
```

| Module | Purpose |
|---|---|
| `IgrDataChartCoreModule` | Core chart infrastructure |
| `IgrDataChartCategoryCoreModule` | Base for category series |
| `IgrDataChartCategoryModule` | Column, Line, Area, Spline etc. |
| `IgrDataChartVerticalCategoryModule` | **Bar series** (horizontal bars) |
| `IgrDataChartInteractivityModule` | Mouse hover, selection |
| `IgrDataChartAnnotationModule` | Tooltip layers, callout layers |
| `IgrLegendModule` | `IgrLegend` component |

### Axis Choice for Bar Charts

| Chart Orientation | Category Axis | Value Axis |
|---|---|---|
| Bar (horizontal) | `IgrCategoryYAxis` | `IgrNumericXAxis` |
| Column (vertical) | `IgrCategoryXAxis` | `IgrNumericYAxis` |

> **Bar charts are horizontal** — categories go on the Y-axis and numeric values on the X-axis. This is the opposite of column charts.

### Complete Bar Chart Component (Multiple Series)

```tsx
import { useRef } from 'react';
import {
IgrLegendModule,
IgrDataChartCoreModule,
IgrDataChartCategoryCoreModule,
IgrDataChartCategoryModule,
IgrDataChartInteractivityModule,
IgrDataChartVerticalCategoryModule,
IgrDataChartAnnotationModule,
IgrLegend,
IgrDataChart,
IgrCategoryYAxis,
IgrNumericXAxis,
IgrCategoryHighlightLayer,
IgrBarSeries,
IgrDataToolTipLayer,
} from 'igniteui-react-charts';
import styles from './bar-chart-view.module.css';

// Register all required modules once at module level
IgrLegendModule.register();
IgrDataChartCoreModule.register();
IgrDataChartCategoryCoreModule.register();
IgrDataChartCategoryModule.register();
IgrDataChartInteractivityModule.register();
IgrDataChartVerticalCategoryModule.register();
IgrDataChartAnnotationModule.register();

interface MovieFranchise {
franchise: string;
totalRevenue: number; // total box office in billions USD
highestGrossing: number; // highest single film in billions USD
}

const movieData: MovieFranchise[] = [
{ franchise: 'Marvel Universe', totalRevenue: 22.55, highestGrossing: 2.80 },
{ franchise: 'Star Wars', totalRevenue: 10.32, highestGrossing: 2.07 },
{ franchise: 'Harry Potter', totalRevenue: 9.19, highestGrossing: 1.34 },
{ franchise: 'Avengers', totalRevenue: 7.76, highestGrossing: 2.80 },
{ franchise: 'Spider Man', totalRevenue: 7.22, highestGrossing: 1.28 },
{ franchise: 'James Bond', totalRevenue: 7.12, highestGrossing: 1.11 },
];

export default function BarChartView() {
const legendRef = useRef<IgrLegend>(null);

return (
<div className={styles['chart-wrapper']}>
<h3 className={styles['legend-title']}>Highest Grossing Movie Franchises</h3>

{/* Legend must be rendered before the chart so the ref is populated */}
<IgrLegend ref={legendRef} orientation="Horizontal" />

<div className={styles['chart-container']}>
<IgrDataChart legend={legendRef.current ?? undefined}>
Comment on lines +188 to +197
Copy link

Copilot AI Apr 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The legend={legendRef.current ?? undefined} pattern won’t reliably wire up the legend: legendRef.current is null during render and refs don’t trigger a re-render when they’re populated, so the chart will likely keep legend as undefined. Use a callback ref / state setter to trigger a re-render, or set chartRef.current.legend in a useEffect after mount (and update the nearby comment that rendering order is sufficient).

Suggested change
return (
<div className={styles['chart-wrapper']}>
<h3 className={styles['legend-title']}>Highest Grossing Movie Franchises</h3>
{/* Legend must be rendered before the chart so the ref is populated */}
<IgrLegend ref={legendRef} orientation="Horizontal" />
<div className={styles['chart-container']}>
<IgrDataChart legend={legendRef.current ?? undefined}>
const chartRef = useRef<IgrDataChart>(null);
const attachLegend = (legend: IgrLegend | null) => {
legendRef.current = legend;
if (chartRef.current) {
chartRef.current.legend = legend ?? undefined;
}
};
const attachChart = (chart: IgrDataChart | null) => {
chartRef.current = chart;
if (chart) {
chart.legend = legendRef.current ?? undefined;
}
};
return (
<div className={styles['chart-wrapper']}>
<h3 className={styles['legend-title']}>Highest Grossing Movie Franchises</h3>
{/* Wire the legend to the chart after mount using callback refs */}
<IgrLegend ref={attachLegend} orientation="Horizontal" />
<div className={styles['chart-container']}>
<IgrDataChart ref={attachChart}>

Copilot uses AI. Check for mistakes.
{/*
* IgrCategoryYAxis — category axis for horizontal bar charts.
* - label: field name that supplies the axis labels.
* - dataSource: the data array (required on the axis for bar charts).
* - isInverted: renders top-to-bottom instead of bottom-to-top.
* - gap / overlap: control bar spacing (gap) and multi-series overlap.
*/}
<IgrCategoryYAxis
name="yAxis"
label="franchise"
dataSource={movieData}
isInverted={true}
gap={0.5}
overlap={-0.1}
useEnhancedIntervalManagement={true}
enhancedIntervalPreferMoreCategoryLabels={true}
/>

{/* IgrNumericXAxis — value axis; start at 0 per bar chart best practices */}
<IgrNumericXAxis
name="xAxis"
title="Billions of U.S. Dollars"
Copy link

Copilot AI Apr 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment says the value axis should "start at 0", but the example doesn’t set any axis minimum. Either set the appropriate axis minimum value property (so the axis actually starts at 0) or remove the claim to avoid misleading readers.

Suggested change
title="Billions of U.S. Dollars"
title="Billions of U.S. Dollars"
minimumValue={0}

Copilot uses AI. Check for mistakes.
/>

{/* Highlight the hovered category row across all series */}
<IgrCategoryHighlightLayer name="categoryHighlight" />

{/* First series — total franchise revenue */}
<IgrBarSeries
name="totalRevenueSeries"
xAxisName="xAxis"
yAxisName="yAxis"
title="Total Revenue of Franchise"
valueMemberPath="totalRevenue"
dataSource={movieData}
showDefaultTooltip={true}
isTransitionInEnabled={true}
isHighlightingEnabled={true}
/>

{/* Second series — highest grossing single film */}
<IgrBarSeries
name="highestGrossingSeries"
xAxisName="xAxis"
yAxisName="yAxis"
title="Highest Grossing Movie in Series"
valueMemberPath="highestGrossing"
dataSource={movieData}
showDefaultTooltip={true}
isTransitionInEnabled={true}
isHighlightingEnabled={true}
/>

{/* Rich tooltip layer — shows all series values on hover */}
<IgrDataToolTipLayer name="tooltips" />
</IgrDataChart>
</div>
</div>
);
}
```

```css
/* bar-chart-view.module.css */
.chart-wrapper {
display: flex;
flex-direction: column;
min-width: 500px;
}

.legend-title {
font-size: 1rem;
font-weight: 600;
text-align: center;
margin-bottom: 0.5rem;
}

.chart-container {
min-height: 400px;
flex-grow: 1;
flex-basis: 0;
}

/* Make the chart fill its container */
.chart-container > * {
height: 100%;
width: 100%;
}
```

### Key Props Reference for `IgrBarSeries`

| Prop | Type | Description |
|---|---|---|
| `name` | `string` | Unique identifier — **required** when referencing the series from other elements |
| `xAxisName` | `string` | Must match the `name` of an `IgrNumericXAxis` declared in the same chart |
| `yAxisName` | `string` | Must match the `name` of an `IgrCategoryYAxis` declared in the same chart |
| `valueMemberPath` | `string` | Field name in the data object that holds the bar length value |
| `dataSource` | `any[]` | The data array — can differ per series for independent datasets |
| `title` | `string` | Series label shown in the legend |
| `isTransitionInEnabled` | `boolean` | Animates bars on initial render |
| `isHighlightingEnabled` | `boolean` | Dims other series when one is hovered |
| `showDefaultTooltip` | `boolean` | Shows a simple built-in tooltip (use `IgrDataToolTipLayer` for richer output) |

### Available Bar Chart Variants

| Variant | Component | Module |
|---|---|---|
| Bar (horizontal) | `IgrBarSeries` | `IgrDataChartVerticalCategoryModule` |
| Stacked Bar | `IgrStackedBarSeries` + `IgrStackedFragmentSeries` | `IgrDataChartStackedModule` |
| Stacked 100% Bar | `IgrStacked100BarSeries` + `IgrStackedFragmentSeries` | `IgrDataChartStackedModule` |

## Complete Grid Lite Example

> **⚠️ IMPORTANT:** Grid Lite (`IgrGridLite` from `igniteui-react/grid-lite`) requires installing both `igniteui-react` and `igniteui-grid-lite` packages. It's a React wrapper component (uses `Igr` prefix) and works like any standard React component — no `.register()` needed.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ Ignite UI for React is distributed across several packages depending on your nee
| [`igniteui-react-charts`](https://www.npmjs.com/package/igniteui-react-charts) | Commercial | `npm install igniteui-react-charts` (trial) | Charts (Category, Financial, Pie, Scatter, etc.) |
| [`igniteui-react-maps`](https://www.npmjs.com/package/igniteui-react-maps) | Commercial | `npm install igniteui-react-maps` (trial) | Geographic maps |
| [`igniteui-react-gauges`](https://www.npmjs.com/package/igniteui-react-gauges) | Commercial | `npm install igniteui-react-gauges` (trial) | Radial and linear gauges |
| [`reveal-sdk-wrappers-react`](https://www.npmjs.com/package/reveal-sdk-wrappers-react) | Commercial | `npm install reveal-sdk-wrappers-react` | Embedded BI dashboards (Reveal SDK) |

> **Note:** The lightweight Grid Lite (`IgrGridLite` from `igniteui-react/grid-lite`) requires installing both `igniteui-react` and `igniteui-grid-lite` packages. It's a React wrapper component (uses `Igr` prefix) that works like any other React component — no `.register()` needed. See [CHARTS-GRIDS.md](./CHARTS-GRIDS.md) for setup details.

Expand Down Expand Up @@ -131,14 +130,6 @@ Use the tables below to map a UI need to the right React component. All componen
|---|---|---|---|
| Chat / AI assistant message thread | `IgrChat` | `igniteui-react` | [Docs](https://www.infragistics.com/products/ignite-ui-react/react/components/interactivity/chat) |

### Embedded Analytics / BI Dashboards (Reveal SDK)

| UI Need | Component | Import | Docs |
|---|---|---|---|
| Embedded BI dashboard viewer | `RvRevealView` | `reveal-sdk-wrappers-react` | [Docs](https://help.revealbi.io/web/getting-started-react/) |

> **Note:** Reveal SDK is a companion product for embedding interactive dashboards and data visualizations. It uses separate packages (`reveal-sdk-wrappers-react`, `reveal-sdk-wrappers`) and requires a backend Reveal server URL. See [REVEAL-SDK.md](./REVEAL-SDK.md) for setup instructions and [../igniteui-react-customize-theme/SKILL.md](../igniteui-react-customize-theme/SKILL.md) for syncing Reveal's theme with Ignite UI theming tokens.

---

## Step-by-Step: Choosing Components for a UI
Expand Down
Loading
Loading