Giter Club home page Giter Club logo

ui5-cc-chart's Introduction

UI5 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.

ui5-cc-chart's People

Contributors

petermuessig avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ui5-cc-chart's Issues

Pros & Cons of NPM package namespaces

For custom control packages namespaces and package name both are valid but package name has the following pros and cons:

Pros:

  • Close to NPM package syntax (simple concept)
  • Resolves version dependency for central deployment
  • Configuration free
  • Thirdparty can be embedded easily (Frontend packages)
  • No shimming knowledge needed

Cons:

  • No individual deployment! => libraries can be deployed individually!
  • New concept => requires exlanation

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.