Skip to content

Instantly share code, notes, and snippets.

@westc
Created September 26, 2023 14:03
Show Gist options
  • Save westc/ae30175483ab4aa10ceb312b85dda3e1 to your computer and use it in GitHub Desktop.
Save westc/ae30175483ab4aa10ceb312b85dda3e1 to your computer and use it in GitHub Desktop.
.addSelect({
name: 'Value Field',
path: 'valueField',
category: ['Display'],
description: 'The field containing the values that will be represented by the bars on the bar chart.',
settings: {
options: [],
getOptions(context) {
const results = context.data[0]?.fields.map(f => ({value: f.name, label: `${f.name} (${f.type})`})) ?? [];
return results as any as Promise<SelectableValue[]>;
},
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment