create circular looking column chart

16 views
Skip to first unread message

rahul shrivastava

unread,
Jan 13, 2018, 12:23:29 PM1/13/18
to d3-js
Hi All,

Sorry for my previous incomplete mail.
I want to create a circular looking column chart as attached.
I am trying to use the gradient feature to create this kind of pattern, but I am nowhere getting close to it.
Following is the gradient code snippet that I am using

 var gradient = container.append("linearGradient")
                             .attr("id", gradientId)
                            .attr("x1", "0%")
                            .attr("y1", "0%")
                            .attr("x2", "100%")
                            .attr("y2", "0%")
                            .attr("spreadMethod", "pad");

            gradient.append("stop")
                    .attr("offset", "0%")
                    .attr("stop-color", mycolor1)
                    .attr("stop-opacity", 1);

            gradient.append("stop")
                    .attr("offset", "20%")
                    .attr("stop-color", mycolor1)
                    .attr("stop-opacity", 0);

            gradient.append("stop")
                    .attr("offset", "100%")
                    .attr("stop-color", mycolor1)
                    .attr("stop-opacity", 1);


Can you please help me here?

Regards
Rahul

column-chart-comparison.png
Reply all
Reply to author
Forward
0 new messages