This is an Angular widget, which is designed to display the chart for the specific event type. It groups the events based on the entered group by parameter and displays the count for each group by parameter value. To display event chart for days enter the group by parameter as 'days' in configuration.
⚠️ This project is no longer under development. Please use cumulocity-event-chart-widget-plugin for Application Builder >=2.x.x and Cumulocity >=1016.x.x⚠️
The charts available include
-
Vertical Bar Chart
-
Horizontal Bar Chart
-
Donut Chart
-
Pie Chart
-
Radar Chart
-
Polar Chart
-
Stack Chart
The widget also comes with an inbuilt color picker, which helps one to customize chart/border colors.
APPLICATION BUILDER | CUMULOCITY | EVENT CHART WIDGET |
---|---|---|
1.3.x | >= 1011.x.x | 2.x.x |
1.2.x | 1010.x.x | 1.x.x |
- Support single device and group devices: Based on widget configuration.
- Supports Event Chart: It displays the Event chart for the selected Event Type and group by parameter in configuration.
- Supports Grouped charts and stack Charts: Based on filter type selected in configuration.
- Supports different flavors charts: Based on chart type field in configuration.
- App Builder: Tested with Cumulocity App Builder version 1.3.0
- This widget support runtime deployment. Download Runtime Binary and use application builder to install your runtime widget.
Prerequisites:
-
Git
-
NodeJS (release builds are currently built with
v14.18.0
) -
NPM (Included with NodeJS)
External dependencies:
"@angular/cdk": "^11.2.13",
"@angular/material": "11.2.3"
"chart.js": "^2.9.3",
"@angular/core": "~11.1.2",
"ng2-charts": "^2.3.2",
"@c8y/ngx-components": "1011.0.12",
"@c8y/ng1-modules": "1011.0.12",
"@c8y/style": "1011.0.12",
Installation Steps For App Builder:
Note: If you are new to App Builder or not yet downloaded/clone app builder code then please follow App builder documentation(Build Instructions) before proceeding further.
- Open Your existing App Builder project and install external dependencies by executing below command or install it manually.
-
Angular fontawesome version 4.7.2
Installation command:
npm i @angular/[email protected]
-
Angular Material version 11.2.3
Installation command:
npm i @angular/[email protected]
-
Ng2-charts version ^2.4.3
Installation command:
npm install [email protected] --save
-
Chart.js version 2.9.3
Installation command :
npm i [email protected]
-
Grab the Event Chart Latest Release Binary
-
Install the Binary file in app builder.
npm i <binary file path>/gp-event-chart-2.0.0.tgz
-
Open index.less located at /cumulocity-app-builder/ui-assets/
-
Update index.less file with below theme. Import at first line in file/begining of file(Please ignore this step if it already exist).
@import '~@angular/material/prebuilt-themes/indigo-pink.css';
@import '~@c8y/style/main.less';
@import '~@c8y/style/extend.less';
- Import GpLibEventChartModule in app.module.ts and also place the imported Module under
@NgModule
.
import {GpLibEventChartModule} from 'gp-event-chart';
@NgModule({
imports: [
GpLibEventChartModule
]
})
- Congratulation! Installation is now completed. Now you can run app builder locally or build and deploy it into your tenant.
//Start App Builder
npm run start
// Build App
npm run build
// Deploy App
npm run deploy
Note: It is only necessary to follow these instructions if you are modifying/extending this widget, otherwise see the Installation Guide.
Prerequisites:
-
Git
-
NodeJS (release builds are currently built with
v14.18.0
) -
NPM (Included with NodeJS)
Instructions
- Clone the repository:
git clone https://github.com/SoftwareAG/cumulocity-event-chart-widget.git
- Change directory:
cd gp-event-chart
- run npm i command to install all library files specified in source code
npm i
- run npm run buildMinor command to create a binary file under dist folder
npm run buildMinor
- (Optional) Local development server:
npm start
- Build the app:
npm run build
- Deploy the app:
npm run deploy
This guide will teach you how to add widget in your existing or new dashboard.
-
Open the Application Builder from the app switcher (Next to your username in the top right)
-
Click Add application
-
Enter the application details and click Save
-
Select Add dashboard
-
Click Blank Dashboard
-
Enter the dashboard details and click Save
-
Select the dashboard from the navigation
-
Check for your widget and test it out.
Congratulations! Event Chart is configured.
- Target Assets/Devices - deviceid/groupid of interest
- Group By- provide the field name from the device managed object on which you want to group.
For eg.
- Set the value to Process if you want to group for each process
- Set the value to date if you want to see the result for each date.
- set the value to time if you want to see the time chart.
- Event Type - name of the event type for which you want chart.
For eg.
- c8y_ProcessStatusUpdate
- s7y_BeaconLocationU
- Legend - position of legend you want or you choose none if you don't want to see legend
- Filter - provide the field name from event object, based on whose value the data will be filtered and will be displayed for each group selected in group by.
For eg.
- Set the value to classification if it is there in your event object. It will display the chart with different classsification for each group.
- Chart Type - type of chart that you want to display.
For eg.
- Stack chart will work only if filter ffield value is set in configuration.
One can also select the custom chart color and Border color to beautify the chart, if not default colors will be picked.
This widget is provided as-is and without warranty or support. They do not constitute part of the Software AG product suite. Users are free to use, fork and modify them, subject to the license agreement. While Software AG welcomes contributions, we cannot guarantee to include every contribution in the master project.
For more information you can Ask a Question in the TECHcommunity Forums.
You can find additional information in the Software AG TECHcommunity.