Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
aliases: [],
type: 'lens_xy_legendConfig',
help: `Configure the xy chart's legend`,
context: {
types: ['null'],
},
args: {
isVisible: {
types: ['boolean'],
help: i18n.translate('xpack.lens.xyChart.isVisible.help', {
defaultMessage: 'Specifies whether or not the legend is visible.',
}),
},
position: {
types: ['string'],
options: [Position.Top, Position.Right, Position.Bottom, Position.Left],
help: i18n.translate('xpack.lens.xyChart.position.help', {
defaultMessage: 'Specifies the legend position.',
}),
},
},
fn: function fn(_context: unknown, args: LegendConfig) {
return {
type: 'lens_xy_legendConfig',
...args,
};
},
};
interface AxisConfig {
title: string;
hide?: boolean;
initialize(frame, state) {
return (
state || {
title: 'Empty XY Chart',
legend: { isVisible: true, position: Position.Right },
preferredSeriesType: defaultSeriesType,
layers: [
{
layerId: frame.addNewLayer(),
accessors: [generateId()],
position: Position.Top,
seriesType: defaultSeriesType,
showGridlines: false,
splitAccessor: generateId(),
xAccessor: generateId(),
},
],
}
);
},