首页 > 解决方案 > 无法显示 boxAndWhisker canvasJS

问题描述

我想用 canvasJS 在 boxAndWhisker 图上显示值。我可以显示带有 X 标签和 Y 值的轴,但我不能显示 boxAndWhisker 图

这是我的代码

 <c:out value="${pointdata}" escapeXml="false" />
<script type="text/javascript">

window.onload = function() { 

        
var chart = new CanvasJS.Chart("chartContainer", {
    animationEnabled: true,
    theme: "light2",
    title:{
        text: "sondes 42"
    },
    subtitles: [{
        text: "controle"
    }],
    
    axisY: {
        title: "intensite des sondes",
        
    },
    data: [{
        type: "boxAndWhisker",
        
        yValueFormatString: "###.##",
        dataPoints :  <%out.print(dataPoints) ;%>
    }]
});
chart.render();
 
}

我的点数据值(json 格式):

[{"y":[146.86,141.54,166.51,121.42],"label":"May 7, 2021 3:24:10 PM"},{"y":[146.86,141.54,166.51,121.42,142.23,135.64,121.04,130.38,132.5,134.26,140.98,121.07,131.79,145.17],"label":"May 6, 2021 3:05:23 PM"},{"y":[146.86,141.54,166.51,121.42,142.23,135.64,121.04,130.38,132.5,134.26,140.98,121.07,131.79,145.17,108.57,119.04,120.21,107.85,106.53,99.82,115.4,95.98],"label":"May 17, 2021 11:46:58 AM"}] 

显示图

显示图表

我不知道如何显示 boxAndWhisker

标签: jsoncanvasjs

解决方案


推荐阅读