Opinion Poll in % graphic :Need Solution ,help

Opinion Poll in % graphic :Need Solution ,help

Dear Sir

I am using opinion poll using jquey


When I click Yes

The  'Yes counter' increases by 1

When I click No

The ' No counter' increases by 1
This is displayed 

Poll » An exhibition of paintings at the ‘Jahangir Art Gallary’ in 2015
yes
Opinion Poll » Yes No

156~132<- this div  displayed only to know the count

In  156~132, 
156 is yes Counter and 132 is No counter

All this is working fine 

My Jquery code

 
  1. <script language="javascript">
  2. $(document).ready(function(){
  3.  
  4.  
  5.  $('#opinionpollyes').click( function() {
  6.   // alert('yes clicked');
  7.     var url = "opinionpollfill.php"
  8.    var data = { 
  9.     id: $('#opinionpollid').val(),
  10. poll:1
  11.  };
  12.   $('#opinionpollfilldiv').load(url, data,Opinionpollcolor );  
  13.  });
  14.    $('#opinionpollno').click( function() {
  15.   //   alert('NO clicked');

  16.     var url = "opinionpollfill.php"
  17.    var data = { 
  18.     id: $('#opinionpollid').val(),
  19. poll:0
  20.  };
  21.   $('#opinionpollfilldiv').load(url, data,Opinionpollcolor );  
  22.  });
  23. function Opinionpollcolor() 
  24. {  
  25.  var opyn= $('#opinionpollfilldiv').text().split('~');
  26.  // alert(opyn[0]+'  '+opyn[1]);
  27.  
  28.  $('#countyes').val(opyn[0]);
  29.  $('#countno').val(opyn[1]);
  30.  
  31.  //alert( parseInt(opyn[0])+parseInt(opyn[1]));
  32.  
  33.  var tot=parseInt(opyn[0])+parseInt(opyn[1]);
  34.  var perecentyes= (parseInt(opyn[0]) / tot) * 100 ;
  35.  var perecentno=  (parseInt(opyn[1]) / tot) * 100 ;

  36. // alert(perecentyes+'  '+perecentno);

  37. var pyn="'"+perecentyes+"%'";


  38.   //alert(pyn);

  39.  $('#opinionpollcolordiv').text('yes'); // unless I put some text here(in this case 'yes', the graphic(the red horizontal bar indicating yes % ) is not displayed 

  40.  //$('#opinionpollcolordiv').css('color','#930');
  41.  $('#opinionpollcolordiv').css('background-color','red');
  42.   //$('#opinionpollcolordiv').css('width', pyn);
  43.   $('#opinionpollcolordiv').css('width', perecentyes+'%');
  44. }
  45.  }); 
  46. </script>
Problem

if I DONOTuse

  1.  $('#opinionpollcolordiv').text('yes'); 
or put some text here the graphic opinion bar is not displayed

I donot want to display any text  here ('yes'in this case )

I just want to display   plain bar indicating the Yes %

In short

yes               

should be displayed as

                    

Thanks in advance