【发布时间】:2021-05-14 15:44:31
【问题描述】:
您好想扩大我的网格距离。 我使用了 amcharts 库的雷达图 我找不到允许我这样做的属性。
HTML
<script src="//cdn.amcharts.com/lib/4/core.js"></script>
<script src="//cdn.amcharts.com/lib/4/charts.js"></script>
<script src="//cdn.amcharts.com/lib/4/themes/animated.js"></script>
<script src="//cdn.amcharts.com/lib/4/themes/kelly.js"></script>
<div id="chartdiv"></div>
CSS
#chartdiv{
width: 100%;
height: 500px;
}
JS
// Create chart instance
var chart = am4core.create("chartdiv", am4charts.RadarChart);
// Add data
chart.data = [{
"country": "Lithuania",
"litres": 501
}, {
"country": "Czech Republic",
"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";
var valueAxis = chart.yAxes.push(new am4charts.ValueAxis());
/* Create and configure series */
var series = chart.series.push(new am4charts.RadarSeries());
series.dataFields.valueY = "litres";
series.dataFields.categoryX = "country";
series.strokeWidth = 2;
我想用自定义值放大(标签的距离) 有什么想法吗?
【问题讨论】:
标签: javascript amcharts