Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

138
Visualizações
Multi the same object in canvas - diffrent sizes and position

I will try to explain what I wish to make. I'm looking for help in making a visualiser on one canvas but in different positions and sizes. I searched and tried many ways, but nothing works.

I want this : enter image description here I have this : enter image description here

   function drawVisualiser(bufferLength, x, barWidth, barHeight, dataArray){
for (let i = 0; i < bufferLength; i++){
    barHeight = dataArray[i];
    var anticlockwise = i%2==0 ? false : true; // clockwise or anticlockwise
    ctx.save();
    ctx.translate(canvas.width/2, canvas.height/2);
    ctx.rotate(i + 4.184);
    const hue = i * 5;
    ctx.strokeStyle = 'hsl(' + hue + ',100%,' + barHeight/1 + '%)';
    ctx.beginPath();
    ctx.lineTo(0, barHeight/5);
    ctx.arc(95,50,40,0,2*Math.PI, anticlockwise);
    ctx.moveTo(10,10);
    ctx.stroke();
    x += barWidth;
    
    if (i > bufferLength * 0.6){
        ctx.beginPath();
        ctx.rotate(i + 1.184);
        ctx.stroke();
    }
    ctx.restore();
}

}

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda