@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
79 lines (76 loc) • 1.38 kB
JavaScript
'use strict';
var base = require('../base');
class DonutChart extends base.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;
}
}
exports.DonutChart = DonutChart;
exports.DonutChartData = DonutChartData;
//# sourceMappingURL=donut.js.map
//# sourceMappingURL=donut.js.map