我的共享点页面上有一个不会缩小的饼图。我使 px 越小,图表越大。例如:
<canvas id="myChart2" width="200px" height="200px" ></canvas>
Run Code Online (Sandbox Code Playgroud)
使图表巨大而同时
<canvas id="myChart2" width="800px" height="200px" ></canvas>
Run Code Online (Sandbox Code Playgroud)
使饼图变小。
馅饼显示完美,我只是不能让它变小。
我正在使用 Chart.JS 中的一些 Java。
HTML是:
<canvas id="myChart2" width="200px" height="200px" ></canvas>
Run Code Online (Sandbox Code Playgroud)
图表选项是:
var options = {
tooltipEvents: [],
showTooltips: true,
onAnimationComplete: function() {
this.showTooltip(this.segments, true);
},
tooltipTemplate: "<%= label %> - <%= value %>",
responsive: true,
scaleBeginAtZero: true,
// you don't have to define this here, it exists inside the global defaults
legendTemplate: "<ul class=\"<%=name.toLowerCase()%>-legend\"><% for (var i=0; i<segments.length; i++){%><li><span style=\"background-color:<%=segments[i].fillColor%>\"></span><%if(segments[i].label){%><%=segments[i].label%><%}%></li><%}%></ul>"
}
// context
var …Run Code Online (Sandbox Code Playgroud) 我有一个从SharePoint列表创建的图形,它在Chrome中工作,但在IE 11中不工作。当我去IE 11中调试时,收到错误消息SCRIPT438: Object doesn't support property or method 'values'。我对JavaScript相当陌生。
有人可以告诉我什么可能是修复程序,或者我缺少什么
我正在使用chart.js和ajax。
<script type="text/javascript" src="/sites/carm/Shared%20Documents/Chart.min.js"></script>
<script type="text/javascript" src="/sites/carm/Shared%20Documents/jquery-1.12.4.min.js"></script>
<script type="text/javascript">
$.ajax({
url: "/sites/carm/_api/web/lists/getbytitle('ATO%20Conditions')/items?$select=ID,Title,m4gs&$top=5000",
type: "GET",
headers: {
"accept": "application/json;odata=verbose",
},
success: function(data) {
if (data.d.results.length > 0) {
var inactiveSet = {};
var activeSet = {};
var otherSet = {};
var totalActive = 0;
var totalInActive = 0;
var totalOther = 0;
var initZero = 0;
$.each(data.d.results, function(index, item) {
if (item.m4gs === "Completed") {
totalInActive++
if (item.Title …Run Code Online (Sandbox Code Playgroud)