• <tfoot id='qv5lp'></tfoot>

    <legend id='qv5lp'><style id='qv5lp'><dir id='qv5lp'><q id='qv5lp'></q></dir></style></legend>

    <i id='qv5lp'><tr id='qv5lp'><dt id='qv5lp'><q id='qv5lp'><span id='qv5lp'><b id='qv5lp'><form id='qv5lp'><ins id='qv5lp'></ins><ul id='qv5lp'></ul><sub id='qv5lp'></sub></form><legend id='qv5lp'></legend><bdo id='qv5lp'><pre id='qv5lp'><center id='qv5lp'></center></pre></bdo></b><th id='qv5lp'></th></span></q></dt></tr></i><div id='qv5lp'><tfoot id='qv5lp'></tfoot><dl id='qv5lp'><fieldset id='qv5lp'></fieldset></dl></div>

      <small id='qv5lp'></small><noframes id='qv5lp'>

          <bdo id='qv5lp'></bdo><ul id='qv5lp'></ul>
      1. 图表js中饼图之间的填充

        Padding Between Pie Charts in chart js(图表js中饼图之间的填充)

          <tfoot id='BmiFk'></tfoot>

          <small id='BmiFk'></small><noframes id='BmiFk'>

            <bdo id='BmiFk'></bdo><ul id='BmiFk'></ul>
              • <legend id='BmiFk'><style id='BmiFk'><dir id='BmiFk'><q id='BmiFk'></q></dir></style></legend>

                    <tbody id='BmiFk'></tbody>
                  <i id='BmiFk'><tr id='BmiFk'><dt id='BmiFk'><q id='BmiFk'><span id='BmiFk'><b id='BmiFk'><form id='BmiFk'><ins id='BmiFk'></ins><ul id='BmiFk'></ul><sub id='BmiFk'></sub></form><legend id='BmiFk'></legend><bdo id='BmiFk'><pre id='BmiFk'><center id='BmiFk'></center></pre></bdo></b><th id='BmiFk'></th></span></q></dt></tr></i><div id='BmiFk'><tfoot id='BmiFk'></tfoot><dl id='BmiFk'><fieldset id='BmiFk'></fieldset></dl></div>
                  本文介绍了图表js中饼图之间的填充的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在使用 chart.js 进行项目,我需要知道是否有办法在饼图的数据集之间添加一些空间.

                  I am working on a project using chart.js for work and I need to know if there is a way to add some space between datasets of a pie chart.

                  到目前为止,我在下面的图表中看到了,我希望内部和外部数据集之间有一些填充.

                  What I have so far is in the chart depicted below, and I want there to be some padding between the inner and outer datasets.

                  我尝试将其中一个图表设置为 doughnut 类型或在内部图表上添加更厚的外边框,但这些都不是我需要的.

                  I have tried setting one of the charts to a doughnut type or adding a thicker outer border on the inner chart, and neither of those are what I needed.

                  推荐答案

                  您可以通过在两个现有数据集之间添加一个空数据集并定义一个 weight 空数据集和内部数据集的属性.

                  You can obtain the desired result by adding an empty dataset between the two existing ones and defining a weight property on the empty and the inner dataset.

                  const colors = ["#FF6384", "#36A2EB", "#FFCE56"];
                  var pieChart = new Chart("myChart", {
                    type: 'pie',
                    data: {
                      labels: ["Red", "Blue", "Yellow"],
                      datasets: [{      
                        data: [8, 5, 6],
                        backgroundColor: colors,
                      }, 
                      { 
                        weight: 0.2
                      },
                      { 
                        data: [5, 7, 4],
                        backgroundColor: colors,
                        weight: 1.2
                      }]
                    }
                  })

                  <script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.9.3/Chart.min.js"></script>
                  <canvas id="myChart"></canvas>

                  这篇关于图表js中饼图之间的填充的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  ChartJS Version 3 - common legend for multiple line charts(ChartJS 版本 3 - 多个折线图的常用图例)
                  Charts.js scales yaxes ticks min max doesnt work(Charts.js 缩放 yaxes 刻度 min max 不起作用)
                  How to expand the slice of donut chart in chartjs?(如何在chartjs中扩展圆环图的切片?)
                  Chart.js yAxes Ticks stepSize not working (fiddle)(Chart.js yAxes Ticks stepSize 不起作用(小提琴))
                  Rounded corners on chartJS v.2 - bar charts (with negative values)(chartJS v.2 上的圆角 - 条形图(带负值))
                  How to hide value in Chart JS bar(如何在 Chart JS 栏中隐藏值)
                  <i id='J04Yl'><tr id='J04Yl'><dt id='J04Yl'><q id='J04Yl'><span id='J04Yl'><b id='J04Yl'><form id='J04Yl'><ins id='J04Yl'></ins><ul id='J04Yl'></ul><sub id='J04Yl'></sub></form><legend id='J04Yl'></legend><bdo id='J04Yl'><pre id='J04Yl'><center id='J04Yl'></center></pre></bdo></b><th id='J04Yl'></th></span></q></dt></tr></i><div id='J04Yl'><tfoot id='J04Yl'></tfoot><dl id='J04Yl'><fieldset id='J04Yl'></fieldset></dl></div>

                        <bdo id='J04Yl'></bdo><ul id='J04Yl'></ul>
                          <tbody id='J04Yl'></tbody>

                        <legend id='J04Yl'><style id='J04Yl'><dir id='J04Yl'><q id='J04Yl'></q></dir></style></legend>

                        <small id='J04Yl'></small><noframes id='J04Yl'>

                          <tfoot id='J04Yl'></tfoot>