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

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

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

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

      1. 离开画布时,chartjs 工具提示被切断

        时间:2023-11-02
        <legend id='nEdEY'><style id='nEdEY'><dir id='nEdEY'><q id='nEdEY'></q></dir></style></legend>

          <tbody id='nEdEY'></tbody>
      2. <tfoot id='nEdEY'></tfoot>

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

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

              <bdo id='nEdEY'></bdo><ul id='nEdEY'></ul>

                • 本文介绍了离开画布时,chartjs 工具提示被切断的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我目前正在使用 chartjs (

                  解决方案

                  有多种解决方法.

                  一种方法(在你的情况下),你可以解决这个问题,就是为你的图表布局设置底部填充,就像这样......

                  选项:{布局: {填充:{底部:25//最适合的设置}},...}

                  var ctx = document.getElementById("myChart").getContext('2d');var myChart = new Chart(ctx, {类型:'线',数据: {标签:['一月','二月','三月','四月','五月','六月','七月','八月','九月'],数据集:[{标签:'标准评级',数据:[0.1, 0.02, 3, 4, 5, 6, 7, 8, 9],backgroundColor: 'rgba(209, 230, 245, 0.5)',borderColor: 'rgba(56, 163, 236, 1)',边框宽度:1}]},选项: {布局: {填充:{底部:25//最适合的设置}},响应:错误,工具提示:{yAlign: '顶部'}}});

                  <script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.5.0/Chart.min.js"></脚本><canvas id="myChart" width="350" height="200"></canvas>

                  I'm currently using chartjs (chartjs).

                  Tooltip is cutted, because it go out of canvas. How I can fix this behavior?

                  解决方案

                  There are multiple ways of solving this.

                  One way (in your case), you can solve this, is by setting the bottom padding for your chart layout , like so ...

                  options: {
                     layout: {
                        padding: {
                           bottom: 25  //set that fits the best
                        }
                     },
                     ...
                  }
                  

                  var ctx = document.getElementById("myChart").getContext('2d');
                  var myChart = new Chart(ctx, {
                     type: 'line',
                     data: {
                        labels: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sept'],
                        datasets: [{
                           label: 'Standard Rating',
                           data: [0.1, 0.02, 3, 4, 5, 6, 7, 8, 9],
                           backgroundColor: 'rgba(209, 230, 245, 0.5)',
                           borderColor: 'rgba(56, 163, 236, 1)',
                           borderWidth: 1
                        }]
                     },
                     options: {
                        layout: {
                           padding: {
                              bottom: 25  //set that fits the best
                           }
                        },
                        responsive: false,
                        tooltips: {
                           yAlign: 'top'
                        }
                     }
                  });

                  <script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.5.0/Chart.min.js"></script>
                  <canvas id="myChart" width="350" height="200"></canvas>

                  这篇关于离开画布时,chartjs 工具提示被切断的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:将逗号添加到 ChartJS 数据点 下一篇:如何在 chart.js 或 D3 中制作阶梯线或阶梯图?

                  相关文章

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

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

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