charts.css icon indicating copy to clipboard operation
charts.css copied to clipboard

What are the hurdles to getting pie charts added?

Open anied opened this issue 3 years ago • 1 comments

The Pie Charts page of the docs note that they are not in the current release, and suggest there is some challenge in getting them production-ready. However, there are no notes specifying what issues are present, and the CodePen example looks pretty good. Can you share what functionality is missing from getting this ready for the next release? I'd happily spend some time working on it if I knew what work was needed.

anied avatar Sep 07 '22 14:09 anied

Hi @anied

As mentioned in CodePen, I want to simplify the framework. To be able to change chart type from 'bar' to pie without changing the <table> structure.

Currently the example in CodePen requires not only the --size variable but also the --start variable. I'm still looking for a way to do the same without the --start variable.

Do you know how we can move the accumulated amount of the "--size" variables to the next TR > TD ?

ramiy avatar Sep 08 '22 08:09 ramiy

I found out adding 0.01 to the calc renders an "acceptable" pie chart

      td {
        @include position-fullwidth();

        transform: rotate( calc( 1turn * var( --start, 0 ) ) );

        background: conic-gradient(
          var( --color, transparent ) 0 calc( 100% * ( var( --size, 0 ) + 0.01 ) ),
          transparent 0 100%
        );

n3storm avatar Nov 15 '22 17:11 n3storm

I think this would necessarily require CSS to keep track of the increasing start position, but there is currently no way of doing that.

AshfordN avatar Dec 28 '22 14:12 AshfordN

Seems like Pie Charts are available now: https://chartscss.org/charts/pie/

It's still missing from the Chart Builder though.

shaunroselt avatar Dec 08 '23 06:12 shaunroselt

@shaunroselt You are correct. Pie chart was added in version 1.0.0. You can read all about it in the Migrate to v1.0 guide and in the pie chart page. You should also check the supported features page.

It's a different type of chart, a circular chart. Most of the features are not yet supported.

ramiy avatar Dec 08 '23 15:12 ramiy