chartsVersion: v1.3
On this page
charts()
This function is used to generate a chart of the top users in a guild.
Parameters
Section titled “Parameters”| Parameter | Type | Required | Description |
|---|---|---|---|
| message | Message | ✅ | The message object. |
| options | ChartOptions | ❌ | The options for the chart. |
Returns <MessageAttachment>
Section titled “Returns <MessageAttachment>”
Throws
Section titled “Throws”new Error()- if invalid parameters are provided, or if there are not enough users to create a chart.
[JS] Example
Section titled “[JS] Example”const { charts } = require("simply-xp");
charts(message, options) .then(console.log) // Returns the chart object .catch((err) => console.log(err)); // Returns the errorChart Options
Section titled “Chart Options”| Options | Type | Required | Default | Description |
|---|---|---|---|---|
position |
Number | ❌ | 5 | Number of users needed to be in the chart |
background |
Hex Code | ❌ | GREY | Background color of the chart |
type |
Chart Type | ❌ | bar | Any one from these 'line' (or) 'bar' (or) 'radar' (or) 'doughnut' (or) 'polarArea |