JS Amcharts - Отзывчивое положение легенды о перемещении
Как быстро изменить положение легенды с «правого» на «нижнее», если, скажем, экран (изменяется) меньше 992 пикселей?
HTML:
<div id="chartdiv"></div>
ЯШ:
var chart = am4core.create("chartdiv", am4charts.PieChart);
chart.data = [{
"country": "Lithuania",
"litres": 501.9
}, {
"country": "Czech Republic",
"litres": 301.9
}, {
"country": "The Netherlands",
"litres": 50,
"hidden": true
}];
var pieSeries = chart.series.push(new am4charts.PieSeries());
pieSeries.dataFields.value = "litres";
pieSeries.dataFields.category = "country";
pieSeries.dataFields.hidden = "hidden";
chart.legend = new am4charts.Legend();
chart.legend.fontSize = 12;
chart.legend.position = "right";
chart.legend.markers.template.width = 12;
chart.legend.markers.template.height = 12;
Скрипка: https://codepen.io/anon/pen/wLEomN