#Cetz pie chart "bleeding" issue

7 messages · Page 1 of 1 (latest)

simple snow
#

When I create a pie chart where all the labels except one have a value of 0, the chart bugs out (as shown in the image). This is my code for the graph:

  cetz.canvas({
    import cetz.draw: *
    import cetz.chart

    chart.piechart(
      (
       ("Over-\nperformed", 0),
       ("Satisfactory", 0),
       ("Disabled", 0),
       ("Under-\nperformed", 10),
      ),
      start: 90deg,
      stop: 450deg,
      gap: 1deg,
      value-key: 1,
      label-key: 0,
      radius: 3.5,
      slice-style: (
       (fill: rgb("#abebb3"), stroke: none),
       (fill: rgb("#fff199"), stroke: none),
       (fill: luma(86.67%), stroke: none),
       (fill: rgb("#ff4136"), stroke: none),
      ),
      inner-radius: 0,
      inner-label: (
        content: "%",
        radius: 120%
      ),
      outer-label: (
        content: (value, label) => {
          let string = label + " (" + str(value)
          string = string.replace(" ", "\n")
          string = string + " " + "mts" + ")"
          align(center)[#string]
        },
        radius: 125%
      )
    )
  })
shrewd basalt
#

Could that be linked to the stop parameter being set to 450deg ?

simple snow
#

i dont think so

#

even after removing that parameter, the issue is still occuring

tidal rapids
#

Seems to be a bug. Can you open an issue on github please? It happens because of the 0% items. If you remove those, it works.

simple snow