虽然我已经包含了响应式js&启用的响应属性为true,雷达图表没有响应。即使在他们的网站上,它也无法对移动视图做出响应。
我该怎么办?
<div id="chartdiv" style="width: 100%; height: 100%;"></div>
这是我的剧本:
<script>
var chart = AmCharts.makeChart("chartdiv1", {
"type": "radar",
"dataProvider": [{
"country": "Czech Republic",
"litres": 156.9
}, {
"country": "Ireland",
"litres": 131.1
}],
"categoryField": "country",
"startDuration": 2,
"valueAxes": [{
"axisAlpha": 0.15,
"minimum": 0,
"dashLength": 3,
"axisTitleOffset": 20,
"gridCount": 5
}],
"graphs": [{
"valueField": "litres",
"title": "Litres",
"bullet": "round",
"balloonText": "[[value]] litres of beer per year"
}],
"legend": {},
"responsive": {
"enabled": true
}
});
</script>
答案 0 :(得分:0)
响应式插件支持雷达图 。 (在amcharts.com上,没有为演示启用响应功能,因此它不是一个好的测试)
以此图表为例:
直播:http://codepen.io/team/amcharts/pen/64459eb6a0041d071b0db44594b2f95a
默认情况下,自适应插件会删除550px或更低的图例:
通过~300px开始删除轴上的标签:
您可以覆盖默认的响应规则或实现您自己的设置,因为它是described here。
请确保在您的网页上加入responsive.min.js
,即:
<script src="//www.amcharts.com/lib/3/plugins/responsive/responsive.min.js" type="text/javascript"></script>