ng2-charts-schematics
Version:
ng2-charts schematics collection for generating chart components
38 lines (35 loc) • 1.44 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const schematics_1 = require("@angular-devkit/schematics");
const ng2_process_tree_1 = require("./ng2-process-tree");
const newCode = `public polarAreaChartLabels: Label[] = ['Download Sales', 'In-Store Sales', 'Mail Sales', 'Telesales', 'Corporate Sales'];
public polarAreaChartData: SingleDataSet = [300, 500, 100, 40, 120];
public polarAreaLegend = true;
public polarAreaChartType: ChartType = 'polarArea';
constructor() { }
ngOnInit() {
}`;
const newMarkup = `<div style="display: block;">
<canvas baseChart
[]="polarAreaChartData"
[]="polarAreaChartLabels"
[]="polarAreaLegend"
[]="polarAreaChartType">
</canvas>
</div>
`;
const newImports = [
['ChartType', 'chart.js'],
['Label, SingleDataSet', 'ng2-charts'],
];
// You don't have to export the function as default. You can also have more than one rule factory
// per file.
function ng2ChartsPolarArea(_options) {
// console.log('options', _options);
return schematics_1.chain([
schematics_1.externalSchematic('@schematics/angular', 'component', _options),
(tree, _context) => ng2_process_tree_1.ng2ProcessTree(tree, _context, _options, newCode, newMarkup, newImports)
]);
}
exports.ng2ChartsPolarArea = ng2ChartsPolarArea;
//# sourceMappingURL=ng2-charts-polar-area.js.map