frappe / charts

Simple, responsive, modern SVG Charts with zero dependencies
https://frappe.io/charts
MIT License
14.9k stars 716 forks source link

Pie Chart Problem #338

Open bobliboya opened 3 years ago

bobliboya commented 3 years ago

Expected Behaviour

Actual Behaviour

The pie chart doesn't work so well... image

<div id="chart"></div>
    <script>
        new Chart("#chart", {
            // or DOM element
            data: {
                labels: [
                    "Person A",
                    "Person B",
                    "Person C",

                ],

                datasets: [{
                    name: "Some Data",
                    chartType: "pie",
                    values: [2000, 1000, 100,]
                }, ],

            },

            title: "My Awesome Chart",
            type: "pie", // or 'bar', 'line', 'pie', 'percentage'
            height: 300,
            colors: ["purple", "#ffa3ef", "light-blue"],
            axisOptions: {
                xAxisMode: "tick",
                xIsSeries: true
            },
            barOptions: {
                stacked: false,
                spaceRatio: 0.5
            },
            tooltipOptions: {
                formatTooltipX: (d) => (d + "").toUpperCase(),
                formatTooltipY: (d) => d + " pts"
            }
        });
    </script>

Steps to Reproduce:

*

NOTE: Add a GIF/Screenshot if required.

Frappé Charts version: Codepen / Codesandbox:

xch1029 commented 3 years ago

the version 1.6.2 is ok.you can try it