Paginator
In some cases - depending on the Layout and Size settings of the legend - only a part of the items is shown simultaneously, and the legend paginator is automatically enabled, allowing you to flip through them.
You can adjust the paginator by combining the legend() method of the chart with paginator() and the following methods:
- currentPage() to specify which page is initially displayed (1 by default)
- layout() to set the
"horizontal"
(default) or"vertical"
layout - orientation() to set the position relative to the legend
- fontColor() to set the font color
- other methods of the anychart.core.ui.Paginator class
// configure the legend paginator
var paginator = chart.legend().paginator();
paginator.layout("vertical");
paginator.orientation("left");
paginator.padding(15);
paginator.fontColor("#dd2c00");
paginator.fontSize(12);
paginator.fontWeight(600);
Please note that the currentPage() method should be called after the chart is drawn:
// initiate drawing the chart
chart.draw();
// set the current page of the paginator
paginator.currentPage(2);