jqPlot 似乎是看不见的
jqPlot seems to be invisible
只要将我的 jqPlot 放在自己的 html 文件中,它就可以正常工作。如果我将它嵌入到另一个 html 文件的 div 中,它就会停止工作。
工作正常(拥有 html 文件)
<div class="generic-container-no-background">
<div id="chart1" style="width:80%; height:80%"></div>
</div>
不再工作(嵌入到另一个 html 文件中)
<div class="generic-container-no-background collapse" id="collapseMembersView">
<div id="chart1" style="width:80%; height:80%"></div>
</div>
图表代码如下:
$(function() {
var line1 = [['Nissan', 4],['Porche', 6],['Acura', 2],['Aston Martin', 5],['Rolls Royce', 6]];
$('#chart1').jqplot([line1], {
title:'Bar Chart with Varying Colors',
seriesColors:['#85802b', '#00749F', '#73C774', '#C7754C', '#00749F'],
seriesDefaults:{
renderer:$.jqplot.BarRenderer,
rendererOptions: {
// Set the varyBarColor option to true to use different colors for each bar.
// The default series colors are used.
varyBarColor: true
}
},
axes:{
xaxis:{
renderer: $.jqplot.CategoryAxisRenderer
}
}
});
});
图表不再显示 - 既不显示背景,也不显示条形图。它似乎是看不见的。谁能提出解决方案?非常感谢。
我不确定它是否有用,但在另一个 html 文件中我也使用了 jsTree 对象和 angular.
如果发现问题!我有一个 div 和 angular data-toggle="collapse".
<div class="ts-sticker-panel" data-toggle="collapse"
data-target="#collapseMembersView" ...>
我删除了折叠 class - 现在显示了图表。
<div class="generic-container-no-background" id="collapseMembersView">
<div id="chart1" style="width:80%; height:80%"></div>
</div>
但如果 jqPlot 可以与 angular 数据切换一起工作,现在仍然很想知道。有人有想法吗?
只要将我的 jqPlot 放在自己的 html 文件中,它就可以正常工作。如果我将它嵌入到另一个 html 文件的 div 中,它就会停止工作。
工作正常(拥有 html 文件)
<div class="generic-container-no-background">
<div id="chart1" style="width:80%; height:80%"></div>
</div>
不再工作(嵌入到另一个 html 文件中)
<div class="generic-container-no-background collapse" id="collapseMembersView">
<div id="chart1" style="width:80%; height:80%"></div>
</div>
图表代码如下:
$(function() {
var line1 = [['Nissan', 4],['Porche', 6],['Acura', 2],['Aston Martin', 5],['Rolls Royce', 6]];
$('#chart1').jqplot([line1], {
title:'Bar Chart with Varying Colors',
seriesColors:['#85802b', '#00749F', '#73C774', '#C7754C', '#00749F'],
seriesDefaults:{
renderer:$.jqplot.BarRenderer,
rendererOptions: {
// Set the varyBarColor option to true to use different colors for each bar.
// The default series colors are used.
varyBarColor: true
}
},
axes:{
xaxis:{
renderer: $.jqplot.CategoryAxisRenderer
}
}
});
});
图表不再显示 - 既不显示背景,也不显示条形图。它似乎是看不见的。谁能提出解决方案?非常感谢。
我不确定它是否有用,但在另一个 html 文件中我也使用了 jsTree 对象和 angular.
如果发现问题!我有一个 div 和 angular data-toggle="collapse".
<div class="ts-sticker-panel" data-toggle="collapse"
data-target="#collapseMembersView" ...>
我删除了折叠 class - 现在显示了图表。
<div class="generic-container-no-background" id="collapseMembersView">
<div id="chart1" style="width:80%; height:80%"></div>
</div>
但如果 jqPlot 可以与 angular 数据切换一起工作,现在仍然很想知道。有人有想法吗?