Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

147
Views
How to fill up a segmented D3 arc

I am fairly new to D3 and generated a segmented arc/half donut chart as shown belowsegmented arc

I used d3.pie and arc to generate this segmented arc chart. Code below:

let pieGenerator = d3
  .pie()
  .startAngle(-0.75 * Math.PI)
  .endAngle(0.75 * Math.PI)
  .padAngle(0.05)
  .sort(null);

let pieGeneratorForeground = d3.pie().startAngle(-0.75 * Math.PI);

var data = [60, 20, 20, 20, 40];

// Create an arc generator with configuration
var arcGenerator = d3.arc().innerRadius(85).outerRadius(100).cornerRadius(5);

var arcData = pieGenerator(data);
console.log(arcData);

// Create a path element and set its d attribute
let arc = d3
  .select("g")
  .selectAll("path")
  .data(arcData)
  .join("path")
  .attr("d", arcGenerator);

What I would like to do is fill up the arc, starting from the left end, to whatever value from 250-850 with a transition. I'm having a hard time finding an example to do this with the use of d3.pie and d3.arc (since that's what I used to generate the segmented arc). Examples I looked at are: arc-progress, arc-gauge Any help or links would be much appreciated. I know I need to use a tween function but I wasn't sure how a tween function could 'fill'/transition the foreground arc between the segmented gaps. Here is a link to a working example of what I have so far: codepen

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!