ui5-cc-chart
A UI5 custom control that wraps Chart.js to render a line chart from label and value records, installed as a plain npm dependency with ui5-tooling-modules in ui5.yaml.
Drawing a chart in a UI5 view means reaching outside the framework's own controls, and this packages Chart.js as one: a Chart control with type, title and color, holding ChartRecord items of a label and a value, declared in an XMLView under the ui5-cc-chart namespace or constructed in JavaScript. It installs as an ordinary npm dependency, and the README's usage adds a second step: ui5-tooling-modulesui5-tooling-modulesA set of UI5 tooling extensions that load and convert plain npm packages into UI5 AMD-like modules, so the UI5 module loader can consume them.community org, ui5 as a dev dependency, with its task and middleware entered in ui5.yaml. It covers one chart type, the line chart.
Facts
Where it sits
Who is behind it
In the atlas: maintains 69@ui5-communitymaintainerPeter MuessigContributes to this
In the atlas: maintains 14, contributes to 80, wrote 1@petermuessig1 contributor
What it declares
Every artifact
- Type
- Package
- Origin
- By a community org
As a package
- Where it runs
- Inside its host
- Distributed through
- npm
Connections
Custom controls, wrappers and icon fonts packaged for reuse
UI5 tooling extensions loading npm packages as UI5 modules
Download
Install
npm add ui5-cc-chartDerived from the package name. No recipe recorded; the README has the configuration.
README
quoted from ui5-community/ui5-cc-chart under Apache-2.0, readUI5 Custom Control: Chart.js
This project includes a custom control which can be consumed as a standard Node/NPM package.json dependency. It provides a wrapper for Chart.js for a LineChart.
Usage
Install the dependency to your UI5 project:
npm install ui5-cc-chart
Include the ui5-tooling-modules tooling extensions to your UI5 project:
npm install ui5-tooling-modules -D
Add the ui5-tooling-modules task and middleware to your ui5.yaml:
specVersion: "2.0"
[...]
builder:
customTasks:
- name: ui5-tooling-modules-task
afterTask: replaceVersion
[...]
server:
customMiddleware:
- name: ui5-tooling-modules-middleware
afterMiddleware: compression
[...]
Now you can use the control either in an XMLView:
<mvc:View controllerName="my.Controller"
xmlns:mvc="sap.ui.core.mvc"
xmlns:chart="ui5-cc-chart">
[...]
<chart:Chart type="line" title="Some Chart" color="green">
<chart:ChartRecord label="Day 1" value="100" />
<chart:ChartRecord label="Day 2" value="50" />
</chart:Chart>
[...]
</mvc:View>
or in your JavaScript code:
sap.ui.define([..., "ui5-cc-chart/Chart", "ui5-cc-chart/Chart"], function(..., Chart, ChartRecord) {
[...]
new Chart({
type: "line",
title: "Some Chart",
color: "green",
records: [
new ChartRecord({label: "Day 1", value: 100}),
new ChartRecord({label: "Day 2", value: 50})
]
})
[...]
});
How to obtain support
Please use the GitHub bug tracking system to post questions, bug reports or to create pull requests.
Contributing
Any type of contribution (code contributions, pull requests, issues) to this showcase will be equally appreciated.
Releasing
To release a new version of the package, you just need to run the following command:
# Release a new version of the package
npm version [major|minor|patch]
# Publish the package (push the change and the tag)
npm run version:publish
License
This work is dual-licensed under Apache 2.0 and the Derived Beer-ware License. The official license will be Apache 2.0 but finally you can choose between one of them if you use this work.
When you like this stuff, buy @mianbsp a beer or buy @pmuessig a coke when you see them.
History
Others providing
Compare all 15 on the Custom controls and libraries page →- custom-controlscustom-controlsThirteen custom controls for abap2UI5, a signature pad and a scanner that reads several barcodes at once among them, each one an ABAP builder class with a single render( ) method and all of them shipped in a BSP of their own.community org, abapThirteen custom UI5 controls for abap2UI5 appsfrom ABAP
- @abap2ui5/embed-control@abap2ui5/embed-controlA UI5 custom control that runs an abap2UI5 app inside a host UI5 app, with the abap2UI5 frontend loaded from the backend the app talks to.community org, ui5UI5 custom control that runs an abap2UI5 app inside a host appfrom UI5
- ui5-cc-timerbuttonui5-cc-timerbuttonA UI5 control library with TimerButton, an sap.m.Button that delays becoming enabled or visible and shows other text or an icon in the meantime, with the delay set in milliseconds.independent, ui5UI5 control library with a button that delays enabling or showingfrom UI5
- ui5-control-generatorui5-control-generatorA command-line generator that writes UI5 custom controls, in JavaScript or TypeScript, from the html files in a project, with control logic and renderer split into two files by default.independent, ui5Command line generator of UI5 custom controls from htmlfrom UI5
- @marianfoo/ui5-cc-dayjs@marianfoo/ui5-cc-dayjsA UI5 custom control that writes a date to the page through Day.js, with the input format, the output format and any shift of days or months set as control properties.independent, ui5UI5 custom control formatting dates with Day.jsfrom UI5
- ui5-cc-pdfviewerui5-cc-pdfviewerA UI5 custom control that renders a PDF from a base64 data URI with pdfjs-dist, so a file picked in the browser can be shown before it has been uploaded anywhere and has a URL.independent, ui5UI5 custom control rendering a PDF from a base64 data URIfrom UI5
- openui5-passwordopenui5-passwordAn OpenUI5 input control of password type that checks the typed value against length and character-class rules set as properties, and scores password strength in a separate property.independent, ui5OpenUI5 password input with strength scoring and rulesfrom UI5
- openui5-touropenui5-tourAn OpenUI5 control library for a step-by-step guided tour inside a UI5 app, where each TourStep has a title, content, a target control from the view and a placement.independent, ui5OpenUI5 control library for guided app toursfrom UI5
- ui5-lib-visualizationui5-lib-visualizationA UI5 control library that wraps the C3.js charting library as ui5.viz controls (Chart, ChartSeries, ChartDataPoint, ChartAxis, ChartLine, ChartArea and Color) declared in an XML view with data binding.independent, ui5UI5 control library wrapping C3.js charts as ui5.viz controlsfrom UI5
- UI5XUI5XAn OpenUI5 and SAPUI5 library of eight composite controls under the ui5x namespace: skeleton placeholders and a container that swaps them for content, loading wrappers for the responsive and the grid table, an accordion, a copy button, a segmented input and a chat feed.independent, ui5UI5 library of eight composite controls under the ui5x namespacefrom UI5
- openui5-cameraopenui5-cameraA UI5 control that renders a live camera preview from the device's camera and hands the app the picture as a base64-encoded PNG when the user taps it.independent, ui5UI5 control for live camera preview and PNG capturefrom UI5
- ui5-cc-mdui5-cc-mdA UI5 custom control that renders Markdown, including GitHub-flavoured syntax, to HTML inside an XML view, taking its content from a string, a file path or a model binding.community org, ui5UI5 custom control rendering Markdown to HTMLfrom UI5
- ui5-fontawesome-libui5-fontawesome-libA UI5 library that adds Font Awesome's regular, solid and brand icon sets to the sap-icon:// namespace, addressable from a standard Icon control, for UI5 1.120.33 or later.community org, ui5UI5 library adding Font Awesome icon sets to sap-icon://from UI5
- openui5-paginatoropenui5-paginatorA UI5 custom control that pages through large data in a table, for backends that serve pages over REST rather than OData.independent, ui5A UI5 custom control that pages through large data in a table, for backends that serve pages over REST rather than OData.from UI5
Details
Sources
Sources are graph entities: the same page may back several entries, and an unreachable source flags every row that rests on it.
Compatibility and provenance
Contributors
History in the atlas
- First seen.
For your agent
- Ref
artifact:ui5-community-ui5-cc-chart- JSON
- /artifacts/ui5-community-ui5-cc-chart.json
- MCP
- Connecting an agent