UNPKG

@microsoft/teams.cards

Version:

<p> <a href="https://www.npmjs.com/package/@microsoft/teams.cards" target="_blank"> <img src="https://img.shields.io/npm/v/@microsoft/teams.cards" /> </a> <a href="https://www.npmjs.com/package/@microsoft/teams.cards?activeTab=code" ta

76 lines (74 loc) 1.33 kB
import { Element } from '../base'; class DonutChart extends Element { type; /** * the title of the chart. */ title; /** * the name of the set of colors to use. */ colorSet; /** * the data to display in the chart. */ data; constructor(...data) { super(); this.type = "Chart.Donut"; this.data = data; } withOptions(value) { Object.assign(this, value); return this; } withTitle(value) { this.title = value; return this; } withColorSet(value) { this.colorSet = value; return this; } addData(...data) { this.data.push(...data); return this; } } class DonutChartData { /** * the color to use for the data point. */ color; /** * the legend of the chart. */ legend; /** * the value associated with the data point. */ value; constructor(value = 0, options = {}) { this.value = value; this.withOptions(options); } withOptions(value) { Object.assign(this, value); return this; } withColor(value) { this.color = value; return this; } withLegend(value) { this.legend = value; return this; } withValue(value) { this.value = value; return this; } } export { DonutChart, DonutChartData }; //# sourceMappingURL=donut.mjs.map //# sourceMappingURL=donut.mjs.map