1.0.1 • Published 5 years ago

@sixphere-polaris/bar-chart v1.0.1

Weekly downloads
3
License
MIT
Repository
-
Last release
5 years ago

Sixphere Polaris - Bar Chart Web Component

Version Node version MIT License

Downloads Total downloads

Packagephobia Bundlephobia


Injectable chart based on @sixphere/chartjs bar chart.

Install

npm install '@sixphere-polaris/bar-chart' --save

HTML API

Attributes

AttributeValuesDescription
widthOptional Number - default: 0Chart width
heightOptional Number - default: 0Chart height
dataOptional Object - default: {}Chart data (see Chart.js reference)
optionsOptional Object - default: {}Chart options (see Chart.js reference)

How to use?

Register as a custom element

import { PolarisBarChart } from '@sixphere-polaris/bar-chart'

customElements.define(PolarisBarChart.is, PolarisBarChart)

Inject a service using DIWrapper

PolarisBarChart implements the API proposed by DIWrapper library. You can use DIWrapper to inject a service which implements asynchronous getData and getOptions methods. This methods must returns an object with the following structure:

// getData() response
{
    data: <Object>
}

Important: You must provide an object which implements the data object structure of Chart.js.

// getOptions() response
{
    options: <Object>
}

Important: You must provide an object which implements the options object structure of Chart.js.

Injection example:

customElements.define(
    PolarisBarChart.is, 
    DIWrapper.for(PolarisBarChart).bind([
        {
            constructor: MyService,
            args: []
        }
    ])
)

HTML element

Display a title

<polaris-numeric-display title="MyDisplay"></polaris-numeric-display>

Author

Sixphere is not only a group of experienced professionals, that keep a huge amount of knowledge, take care about what and how they do their job. They solve their partner problems in an agile way and are aware of their customer needs through emotional intelligence connections.

Sixphere is a simpler way of understanding IT services, based on a strong and well balanced mix-ture of principles.

License

MIT License © 2019 Sixphere