charts()
This function is used to generate a chart of the top users in a guild.
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
message | Message | ✅ | The message object. |
options | ChartOptions | ❌ | The options for the chart. |
Returns <MessageAttachment>
Throws
new Error()
- if invalid parameters are provided, or if there are not enough users to create a chart.
[JS] Example
const {charts} = require("simply-xp");
charts(message, options)
.then(console.log) // Returns the chart object
.catch((err) => console.log(err)); // Returns the error
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 |