SAP Home Learn Build Integrate Model Operate Extend with AI ConnectTutorial navigator Knowledge Graph API Devtoberfest Developer Advocates App Space

Manage my Account SAP Devs YouTube ↗ Learnings ↗ Community ↗ Provide Feedback ↗
Logout
β€’ Open full site

Integrate Charts and Conditional Rendering

Display data in charts using UI5 Web Components for React.

Overview

🎓 beginner 20 min. HTML5BeginnerSAP Fiori

You will learn

  • βœ”How to install and import charts
  • βœ”Learn about charts in UI5 Web Components for React
  • βœ”How to add dynamic rendering
Lukas Harbarth L Lukas Harbarth April 22, 2025
Created by December 5, 2019
Contributors

Prerequisites

Steps

Intro

UI5 Web Components for React also comes with a chart library. In this tutorial, you will integrate two chart types and add data to them. Also, you will learn how to conditionally render components, and how React handles updates to the DOM and single components.


Step 1 Install module and import charts
β€”

  1. Install the chart library of UI5 Web Components for React.

    Shell
     npm install @ui5/webcomponents-react-charts

    Note: When facing issues with installing, please ensure you’re using the same minor version as the other @ui5/webcomponents... packages.

  2. Then, import LineChart and BarChart into MyApp.tsx.

    TypeScript
    import { BarChart, LineChart } from "@ui5/webcomponents-react-charts";
Step 2 Add charts to Card component
+
Step 3 Add conditional rendering
+
Step 4 Update a component in React - Loading Indicator
+
Step 5 Add dynamic header and text
+

Resources

Discussion

Share feedback on this tutorial or join the conversation in SAP Community.

Submit detailed feedback Discuss in Community
Steps
Step 1 of 5
1. Install module and import charts 2. Add charts to Card component 3. Add conditional rendering 4. Update a component in React - Loading Indicator 5. Add dynamic header and text

Learn more →