@covalent/echarts
Version:
Teradata UI Platform Echarts Module
66 lines (52 loc) • 1.59 kB
Markdown
`td-chart-series[td-bar]` element generates a bar series echarts visualization inside a `td-chart`. Its the equivalent of creating a JS series object `type="bar"` in echarts.
- config?: any
- Sets the JS config object if you choose to not use the property inputs.
- Note: [config] input properties will override input values
There are also lots of property inputs like:
- id?: string
- It can be used to refer the component in option or API.
- name?: string
- Series name used for displaying in tooltip and filtering with legend.
- color?: any
- Global color for the series.
- data?: any[]
- Data array of series.
And so many more.. for more info [click here](https://echarts.apache.org/en/option.html#series-bar)
Import the [CovalentBarEchartsModule] in your NgModule:
```typescript
import { CovalentBaseEchartsModule } from '@covalent/echarts/base';
import { CovalentBarEchartsModule } from '@covalent/echarts/bar';
@NgModule({
imports: [
CovalentBaseEchartsModule,
CovalentBarEchartsModule,
...
],
...
})
export class MyModule {}
```
Basic Example:
```html
<td-chart>
<td-chart-x-axis
[]="true"
[]="'category'"
[]="['Electronics', 'Toys', 'Grocery', 'Appliances', 'Automotive', 'Sports']"
>
</td-chart-x-axis>
<td-chart-y-axis [show]="true" [type]="'value'"> </td-chart-y-axis>
<td-chart-series
td-bar
[]="'name'"
[]="[150, 130, 150, 120, 150, 120]"
[]="'#F2724B'"
>
</td-chart-series>
</td-chart>
```