Getting Started with the KendoReact Chart WizardPremium
This guide provides the information you need to start using the KendoReact Chart Wizard—it includes instructions about the recommended installation approach, the code for running the project, and links to additional resources.
After the completion of this guide, you will be able to achieve an end result as demonstrated in the following example.
Setting Up Your React Project
Before you start with the installation of any Kendo UI for React control, ensure that you have a running React project. The prerequisites to accomplish the installation of the components are always the same regardless of the KendoReact package you want to use, and are fully described in the section on setting up your React project.
Installing the Component
All KendoReact packages are distributed through npm and offer a similar installation experience. To use the PDF Viewer component, start with the installation of the PDF Viewer npm package and its dependencies.
npm install --save @progress/kendo-react-chart-wizard @progress/kendo-react-buttons @progress/kendo-react-charts @progress/kendo-react-common @progress/kendo-react-dialogs @progress/kendo-react-form @progress/kendo-react-dropdowns @progress/kendo-react-grid @progress/kendo-react-inputs @progress/kendo-react-intl @progress/kendo-react-labels @progress/kendo-react-layout @progress/kendo-react-popup @progress/kendo-svg-icons @progress/kendo-licensing
Importing the Component
After installing the package, import the PDF Viewer component in the React App.
- In the
src/App.js
file of your React project, import theChartWizard
andChartWizardRow
components to enable the entire feature set of the Chart Wizard:
// ES2015 module syntax
import {
ChartWizard,
ChartWizardDataRow
} from '@progress/kendo-react-chart-wizard';
// CommonJS format
const {
ChartWizard,
ChartWizardDataRow
}= require('@progress/kendo-react-chart-wizard');
Using the Component
-
After successfully installing the Chart Wizard package and importing its component, add the following code to the App component file of your React project (for example,
src/App.tsx
).jsx<ChartWizard data={chartWizardData} />
-
Bind the
data
property to an object array in theApp.tsx
file:tspublic data: ChartWizardDataRow[] = [ [ { field: 'Product Name', value: 'Calzone' }, { field: 'Quantity', value: 1 }, { field: 'Price', value: 12.39 }, { field: 'Tax', value: 2.48 }, { field: 'Total', value: 14.87 } ], [ { field: 'Product Name', value: 'Margarita' }, { field: 'Quantity', value: 2 }, { field: 'Price', value: 8.79 }, { field: 'Tax', value: 3.52 }, { field: 'Total', value: 21.1 } ], [ { field: 'Product Name', value: 'Pollo Formaggio' }, { field: 'Quantity', value: 1 }, { field: 'Price', value: 13.99 }, { field: 'Tax', value: 2.8 }, { field: 'Total', value: 16.79 } ] ];
-
To style the PDF Viewer, install and import the Default theme, which is one of the four beautiful themes for KendoReact.
3.1. Install the Default theme package.
shnpm install --save @progress/kendo-theme-default
3.2. Import the CSS file from the package in
src/App.tsx
. Add this import before your existingApp.css
import.jsximport '@progress/kendo-theme-default/dist/all.css';
-
Build and run the application by typing the following command in the root folder of your project:
shnpm start
-
Navigate to http://localhost:3000 to see the KendoReact PDF Viewer component on the page.
Activating Your License Key
Using any of the UI components in the KendoReact library requires either a commercial license key or an active trial license key.
Follow the instructions on the KendoReact My License page to activate your trial or commercial license. You can skip this step if your application already contains a KendoReact license file.
Dependencies
The PDF Viewer package requires you to install the following peer dependencies in your application:
Package Name | Description |
---|---|
react 16.8.2* | Contains the functionality necessary to define React components. |
react-dom | Contains the React renderer for the web. |
@progress/kendo-react-buttons | Contains the KendoReact Button components. |
@progress/kendo-react-charts | Contains the KendoReact Chart components. |
@progress/kendo-react-common | Contains common utilities that enhance the performance and functionalities of the KendoReact UI components. |
@progress/kendo-react-dialogs | Contains the KendoReact Dialog components. |
@progress/kendo-react-form | Contains the KendoReact Form components. |
@progress/kendo-react-dropdowns | Contains the KendoReact Dropdowns, which allows users to choose from a predefined list of options. |
@progress/kendo-react-grid | Contains the KendoReact Data Grid component. |
@progress/kendo-react-inputs | Contains the KendoReact Inputs, which the input of data, based on a specific and predefined format. |
@progress/kendo-react-intl | Contains the KendoReact Internationalization package that applies the desired cultures by providing services and pipes for the parsing and formatting of dates and numbers. |
@progress/kendo-react-labels | Contains the KendoReact Label components. |
@progress/kendo-react-layout | Contains the KendoReact Layout components. |
@progress/kendo-react-popup | Contains the KendoReact Popup components. |
@progress/kendo-licensing | Contains the internal infrastructure related to licensing. |
@progress/kendo-svg-icons | Contains the KendoReact SVG icons. |