我很困惑如何通过我的数据百分比饼图或通过数据库中的ajax数据放置值。我已经通过使用id成功传递了其他字段,但是在数据百分比中,我很困惑如何将数据百分比的值放到我的饼图中。我正在使用Codeigniter框架。将ajax数据值传递到数据百分比饼图
这是我想要的。事情是这样的: 从数据库中获取数据我的Ajax代码:
function showprojectdetails(projectSelected) {
var studentId = null;
$.ajax({
url : "<?php echo site_url('manager/projects/ProjDetails/')?>/" + projectSelected,
type: "GET",
dataType: "JSON",
success: function(data) {
//this is data percent
$('#progress-pie-chart').html(data['project_percent']);
},
error: function (jqXHR, textStatus, errorThrown) {
alert('Error get data from ajax');
}
});
}
,这里是我的数据进步饼图在这里我想提出的数据百分比值:事情是这样的:数据%的“ 35.6" 是我想从阿贾克斯与我project_percent的值来代替
<div class="progress-pie-chart" data-percent="35.6"><!--Pie Chart -->
<div class="ppc-progress">
<div class="ppc-progress-fill"></div>
</div>
<div class="ppc-percents">
<div class="pcc-percents-wrapper">
<span>%</span>
</div>
</div>
</div>
'$('。progress-pie-chart')。html(data ['project_percent']);'? – madalinivascu
@Jc John $('#projectPercent')。html代替使用$(“。progress-pie-chart”)。html – Elangovan
谢谢你的回答..我会试试 –