Getting Started
To use the HSB Dashboard SDK, follow these steps:
Installation
Install the SDK package via npm
npm i hsb-dashboard-sdk
Usage
- Import the necessary classes into your project.
- Instantiate the classes and utilize the SDK methods as per your requirements.
import { Dashboard, Row, Cell, BarChart, PieChart } from 'dashboard-sdk';
const barChart = new BarChart(
"1",
"Barchart Title",
["field1", "field2"],
["groupBy1", "groupBy2"]
);
const pieChart = new PieChart("1", "Pie Chart Title", "field2", "groupBy1");
const firstCell = new Cell(barChart, 6);
const secondCell = new Cell(pieChart, 8);
const emptyCell = new Cell(undefined);
const firstRow = new Row("Heading 1", [firstCell, emptyCell]);
const secondRow = new Row("Heading 2", [secondCell, emptyCell]);
const dashboard = new Dashboard([firstRow, secondRow]);