D
D
dimastd2015-05-09 14:41:03
infographics
dimastd, 2015-05-09 14:41:03

Question about "progress-pie-chart"?

Hello. I don't know how to phrase the question correctly, but I'll try.
I want to attach a rotating indicator to the page, here is its code:

function sh1(){ /* рисование первого индикатора */

  var $ppc = $('.progress-pie-chart'),
    percent = parseInt($ppc.data('percent')),
    deg = 360*percent/100;
  if (percent > 50) {
    $ppc.addClass('gt-50');
  }
  $('.ppc-progress-fill').css('transform','rotate('+ deg +'deg)');
  $('.ppc-percents span').html(percent+'%    D5'); /* название на кнопке - D5 */

<div class="progress-pie-chart" data-percent="78">
  <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>

I have a variable like var = 10;
How to assign it to an indicator?
That is, now it has a value of 78 (div class="progress-pie-chart" data-percent="78"), how to change it?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question