• <legend id='o8sGB'><style id='o8sGB'><dir id='o8sGB'><q id='o8sGB'></q></dir></style></legend>

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

  • <tfoot id='o8sGB'></tfoot>
      <bdo id='o8sGB'></bdo><ul id='o8sGB'></ul>

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

      1. Chart.js PolarArea 图表.将标签更改为 45 度角

        Chart.js PolarArea Chart. Changing the labels to a 45 degree angle(Chart.js PolarArea 图表.将标签更改为 45 度角)
        1. <small id='3QlyF'></small><noframes id='3QlyF'>

            <tbody id='3QlyF'></tbody>
          <legend id='3QlyF'><style id='3QlyF'><dir id='3QlyF'><q id='3QlyF'></q></dir></style></legend>
            <i id='3QlyF'><tr id='3QlyF'><dt id='3QlyF'><q id='3QlyF'><span id='3QlyF'><b id='3QlyF'><form id='3QlyF'><ins id='3QlyF'></ins><ul id='3QlyF'></ul><sub id='3QlyF'></sub></form><legend id='3QlyF'></legend><bdo id='3QlyF'><pre id='3QlyF'><center id='3QlyF'></center></pre></bdo></b><th id='3QlyF'></th></span></q></dt></tr></i><div id='3QlyF'><tfoot id='3QlyF'></tfoot><dl id='3QlyF'><fieldset id='3QlyF'></fieldset></dl></div>
            • <bdo id='3QlyF'></bdo><ul id='3QlyF'></ul>

                • <tfoot id='3QlyF'></tfoot>

                  本文介绍了Chart.js PolarArea 图表.将标签更改为 45 度角的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我在网上搜索了如何解决这个问题没有成功.我见过人们使用背景图片,但这似乎很懒惰且无益.我想将标签移动到 45 度角,这样看起来更专业.

                  I have searched through the net with no success on how to solve this. I have seen people use a background image but that seems lazy and unhelpful. I want to move the labels to a 45 degree angle so it looks more professional.

                  我的图表目前看起来像这样 -

                  My chart currently looks like this -

                  但我希望它看起来像这样 -

                  But I am wanting it to look like this -

                  有人对我如何做到这一点有任何想法吗?

                  Anyone have any ideas on how I can do this?

                  我的代码副本在下面.

                      new Chart(DummyChart, {
                        type: "polarArea",
                        data: {
                          labels: ["Dummy1", "Dummy 2", "Dummy 3", "Dummy 4"],
                          datasets: [
                            {
                              data: [125, 375, 300, 240],
                              backgroundColor: "#57C5C8",
                              borderWidth: 4,
                              hoverBorderColor: "white",
                              label: "Dummy Dummy "
                            }
                          ]
                        },
                        options: {
                          cutoutPercentage: 20,
                          legend: {
                            display: false
                          },
                          layout: {
                            padding: 0
                          },
                          scale: {
                            ticks: {
                              max: 450,
                              maxTicksLimit: 1,
                              display: false
                            },
                            angleLines: {
                              display: true
                            },
                            pointLabels: {
                              display: true
                            }
                          },
                          plugins: {
                            datalabels: {
                              display: false
                            }
                          }
                        }
                      });
                  
                  

                  推荐答案

                  这是我使用 datalables 插件的解决方案.

                  Here's my solution with the datalables plugin.

                  https://jsbin.com/bigedugasi/1/edit?html,js,输出

                  我已经更新了我以前的解决方案以使图表具有响应性.

                  I have updated my previous solutions to make the chart responsive.

                      plugins: {
                        datalabels: {
                          formatter: function(value, context) {
                            return context.chart.data.labels[context.dataIndex];
                          },
                          anchor: 'start',
                          align: 'end',
                          offset: 0 // Gets updated
                        }
                      },
                      onResize: function() {
                        let width = document.getElementById("pie-chart").width
                        let padding = myChart.options.layout.padding
                        myChart.options.plugins.datalabels.offset = width/2-padding
                      }
                  

                  这篇关于Chart.js PolarArea 图表.将标签更改为 45 度角的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  在开发JS过程中,会经常遇到两个小数相运算的情况,但是运算结果却与预期不同,调试一下发现计算结果竟然有那么长一串尾巴。如下图所示: 产生原因: JavaScript对小数运算会先转成二进制,运算完毕再转回十进制,过程中会有丢失,不过不是所有的小数间运算会
                  问题描述: 在javascript中引用js代码,然后导致反斜杠丢失,发现字符串中的所有\信息丢失。比如在js中引用input type=text onkeyup=value=value.replace(/[^\d]/g,) ,结果导致正则表达式中的\丢失。 问题原因: 该字符串含有\,javascript对字符串进行了转
                  Rails/Javascript: How to inject rails variables into (very) simple javascript(Rails/Javascript:如何将 rails 变量注入(非常)简单的 javascript)
                  quot;Each child in an array should have a unique key propquot; only on first time render of page(“数组中的每个孩子都应该有一个唯一的 key prop仅在第一次呈现页面时)
                  CoffeeScript always returns in anonymous function(CoffeeScript 总是以匿名函数返回)
                  Ordinals in words javascript(javascript中的序数)

                    <tbody id='oe5RY'></tbody>
                    • <bdo id='oe5RY'></bdo><ul id='oe5RY'></ul>

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

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