-
Notifications
You must be signed in to change notification settings - Fork 321
features legend
κΉμ§μ° edited this page Jan 25, 2018
·
8 revisions
- This section introduces about feature of legend.
Using legend.align option, you can change align of legend.
Kind of align option values are 'top', 'bottom', 'left' and 'right'.
//...
var options = {
legend: {
align: 'top'
}
};
tui.chart.barChart(container, data, options);Using legend.visible option, you can hide legend.
//...
var options = {
legend: {
visible: false
}
};
tui.chart.barChart(container, data, options);Using legend.showCheckbox option, you can hide checkbox of legend.
Default value for this option is true and will be hidden when you set up false.
//...
var options = {
legend: {
showCheckbox: false
}
};
tui.chart.barChart(container, data, options);If you attach selectLegend event handler, you can getting information of legend when selecting legend.
//...
var chart = tui.chart.barChart(data);
chart.on('selectLegend', function(info) {
console.log(info);
});Using legend.maxWidth option, you can omit the legend name beyond the length.
//...
var options = {
legend: {
maxWidth: 70
}
};
tui.chart.barChart(container, data, options);- Chart Guide