@sixphere-polaris/bar-chart
v1.0.1
Published
Injectable chart based on @sixphere/chartjs bar chart
Downloads
23
Readme
Sixphere Polaris - Bar Chart Web Component
Injectable chart based on @sixphere/chartjs bar chart.
Install
npm install '@sixphere-polaris/bar-chart' --save
HTML API
Attributes
| Attribute | Values | Description | |-----------|--------------------------------------------------------|------------------------------------------------------------------| | width | [Optional] Number - default: 0 | Chart width | | height | [Optional] Number - default: 0 | Chart height | | data | [Optional] Object - default: {} | Chart data (see Chart.js reference) | | options | [Optional] 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