Javascript 图表不显示在引导模式内
我想在引导模式中显示图表。此处的代码: 但它不工作,图表不显示。如何解决这个问题Javascript 图表不显示在引导模式内,javascript,jquery,twitter-bootstrap,bootstrap-modal,Javascript,Jquery,Twitter Bootstrap,Bootstrap Modal,我想在引导模式中显示图表。此处的代码: 但它不工作,图表不显示。如何解决这个问题 $(文档).ready(函数(){ 变量行1=['08年5月23日',578.55],'08年6月20日',566.5],'08年7月25日',480.88],'08年8月22日',509.84]; 变量plot1=$.jqplot('chart1',[line1]{ 标题:“数据点突出显示”, 轴线:{ xaxis:{ 渲染器:$.jqplot.DateAxisRenderer, 选择:{ 格式字符串:
$(文档).ready(函数(){
变量行1=['08年5月23日',578.55],'08年6月20日',566.5],'08年7月25日',480.88],'08年8月22日',509.84];
变量plot1=$.jqplot('chart1',[line1]{
标题:“数据点突出显示”,
轴线:{
xaxis:{
渲染器:$.jqplot.DateAxisRenderer,
选择:{
格式字符串:'%b%#d'
}
},
亚克斯:{
选择:{
formatString:“$%.2f”
}
}
});
$('#myModal').bind('显示',函数()){
plot1.replot();
});
});
#button type=“button”class=“btn btn primary btn lg active”数据切换=“modal”数据目标=“#myModel”>绘制显示完成模式框后必须显示字符 在引导程序3中:
$('#myModal').on('shown.bs.modal', function (e) {
var plot1 = $.jqplot('chart1', [line1], {
title:'Data Point Highlighting',
axes:{
xaxis:{
renderer:$.jqplot.DateAxisRenderer,
tickOptions:{
formatString:'%b %#d'
}
},
yaxis:{
tickOptions:{
formatString:'$%.2f'
}
}
});
});
尝试在模态之后绘制图表,如下所示:
$('#myModal').modal();
// and then
$('#myModal').on('shown.bs.modal', function (e) {
plot1.replot();
//...
你能把这个加到JS提琴里,这样我就可以改变它了吗?
$('#myModal').on('shown.bs.modal', function (e) {
var plot1 = $.jqplot('chart1', [line1], {
title:'Data Point Highlighting',
axes:{
xaxis:{
renderer:$.jqplot.DateAxisRenderer,
tickOptions:{
formatString:'%b %#d'
}
},
yaxis:{
tickOptions:{
formatString:'$%.2f'
}
}
});
});
$('#myModal').modal();
// and then
$('#myModal').on('shown.bs.modal', function (e) {
plot1.replot();
//...