Radar Chart with full-width cursor
This quick demo shows how you can enable a full-width chart cursor on a RadarChart.
Open in:New tab
/** * --------------------------------------- * 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/ * --------------------------------------- */
// Themes beginam4core.useTheme(am4themes_animated);// Themes end
/* Create chart instance */var chart = am4core.create("chartdiv", am4charts.RadarChart);
/* Add data */chart.data = [ { country: "Lithuania", litres: 501 }, { country: "Czechia", litres: 301 }, { country: "Ireland", litres: 266 }, { country: "Germany", litres: 165 }, { country: "Australia", litres: 139 }, { country: "Austria", litres: 336 }, { country: "UK", litres: 290 }, { country: "Belgium", litres: 325 }, { country: "The Netherlands", litres: 40 }];
/* Create axes */var categoryAxis = chart.xAxes.push(new am4charts.CategoryAxis());categoryAxis.dataFields.category = "country";categoryAxis.renderer.grid.template.location = 0.5;categoryAxis.renderer.tooltipLocation = 0.001;
var valueAxis = chart.yAxes.push(new am4charts.ValueAxis());valueAxis.renderer.axisFills.template.fill = chart.colors.getIndex(2);valueAxis.renderer.axisFills.template.fillOpacity = 0.05;
/* Create and configure series */var series = chart.series.push(new am4charts.RadarSeries());series.dataFields.valueY = "litres";series.dataFields.categoryX = "country";series.name = "Sales";series.strokeWidth = 3;
chart.cursor = new am4charts.RadarCursor();chart.cursor.fullWidthLineX = true;chart.cursor.xAxis = categoryAxis;chart.cursor.lineY.disabled = true;chart.cursor.lineX.fill = chart.colors.getIndex(3);chart.cursor.lineX.fillOpacity = 0.3;<div id="chartdiv"></div>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: 500px;}radar-chart-with-full-width-cursor