AmChartsV4 Legend Marker Stroke issue
https://github.com/amcharts/amcharts4/issues/279
by amcharts
HTML
<script src="//www.amcharts.com/lib/4/core.js"></script>
<script src="//www.amcharts.com/lib/4/charts.js"></script>
<script src="//www.amcharts.com/lib/4/themes/animated.js"></script>
<div id="chartdiv"></div>
CSS
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
}
#chartdiv {
width: 100%;
height: 600px;
}
JavaScript
/**
* ---------------------------------------
* This demo was created using amCharts 4.
*
* For more information visit:
* https://www.amcharts.com/
*
* Documentation is available at:
* https://www.amcharts.com/docs/v4/
* ---------------------------------------
*/
// Create chart instance
var chart = am4core.create("chartdiv", am4charts.PieChart);
// Add data
chart.data = [{
"country": "Lithuania",
"litres": 501.9
}, {
"country": "Czech Republic",
"litres": 301.9
}, {
"country": "Ireland",
"litres": 201.1
}, {
"country": "Germany",
"litres": 165.8
}, {
"country": "Australia",
"litres": 139.9
}, {
"country": "Austria",
"litres": 128.3
}, {
"country": "UK",
"litres": 99
}, {
"country": "Belgium",
"litres": 60
}, {
"country": "The Netherlands",
"litres": 50
}];
const legendDisabledColor = '#c6c6c6';
// Add and configure Series
var pieSeries = chart.series.push(new am4charts.PieSeries());
pieSeries.dataFields.value = "litres";
pieSeries.dataFields.category = "country";
// Let's cut a hole in our Pie chart the size of 40% the radius
chart.innerRadius = am4core.percent(40);
// Disable ticks and labels
pieSeries.labels.template.disabled = true;
pieSeries.ticks.template.disabled = true;
// Disable tooltips
pieSeries.slices.template.tooltipText = "";
// Add a legend
chart.legend = new am4charts.Legend();
chart.legend.useDefaultMarker = true;
const markerTemplate = chart.legend.markers.template;
markerTemplate.width = 8;
markerTemplate.height = 8;
const marker = chart.legend.markers.template.children.getIndex(0);
marker.cornerRadius(8, 8, 8, 8);
const legendLabelDisabled = chart.legend.labels.template.states.getKey('active');
legendLabelDisabled.properties.fill = am4core.color(legendDisabledColor);
const legendValueLabelDisabled = chart.legend.valueLabels.template.states.getKey('active');
legendValueLabelDisabled.properties.fill = am4core.color("red");
const markerDisabled =...