Skip to content

Commit

Permalink
fix(Chart): expose type coercion functions for charts
Browse files Browse the repository at this point in the history
  • Loading branch information
benjamincharity committed May 15, 2019
1 parent 6b7f3b0 commit 193d482
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion terminus-ui/chart/src/chart.component.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
- [Inject the needed libraries](#inject-the-needed-libraries)
- [Set up the chart](#set-up-the-chart)
- [Supported chart types](#supported-chart-types)
- [Chart Type Coercion](#chart-type-coercion)
- [AmCharts documentation](#amcharts-documentation)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->
Expand Down Expand Up @@ -81,13 +82,34 @@ setUpChart(chart: am4charts.Chart) {
- `pie`
- `map`
- `radar`
- `treemap`
- `tree`
- `sankey`
- `chord`
> See `TsChartVisualizationOptions` for all supported types.
### Chart Type Coercion
The library exposes functions for coercing to specific chart types:
- `tsChartXYTypeCheck`
- `tsChartPieTypeCheck`
- `tsChartMapTypeCheck`
- `tsChartRadarTypeCheck`
- `tsChartTreeTypeCheck`
- `tsChartSankeyTypeCheck`
- `tsChartChordTypeCheck`
Example:
```typescript
if (tsChartXYTypeCheck(chart)) {
// Now we know we are dealing with an XY chart type
}
```
## AmCharts documentation
See https://www.amcharts.com/docs/v4/ for full documentation.

0 comments on commit 193d482

Please sign in to comment.