• <small id='zpcwu'></small><noframes id='zpcwu'>

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

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

        <tfoot id='zpcwu'></tfoot>
      1. <legend id='zpcwu'><style id='zpcwu'><dir id='zpcwu'><q id='zpcwu'></q></dir></style></legend>

      2. 在哪里放置“multiTooltipTemplate"在 Chart.js v2.x 中

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

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

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

              <tbody id='RXCDf'></tbody>
                  <bdo id='RXCDf'></bdo><ul id='RXCDf'></ul>
                  本文介绍了在哪里放置“multiTooltipTemplate"在 Chart.js v2.x 中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我想更改datasetlabel"宽度multiTooltipTemplate"的标签".但我只为以前版本的 chart.js 找到解决方案

                  i want to change the "label" for the "datasetlabel" width "multiTooltipTemplate". But i find the solution only for the previous version of chart.js

                  你能告诉我如何转换吗:

                  Can you tell me how to convert this :

                  multiTooltipTemplate: "<%%=datasetLabel%> : <%%= value %>",
                  

                  到 Chart.js 的第 2 版

                  To the version 2 of Chart.js

                  现在我得到了这个选项:

                  For now i got this in option :

                      options: {
                  tooltips: {
                              enabled: true,
                              mode: 'single',
                              callbacks: {
                                  label: function(tooltipItems, data) { 
                                      return tooltipItems.yLabel + ' ';
                                  }
                              }
                          },
                  }
                  

                  感谢您的帮助

                  推荐答案

                  你的 options 对象应该是

                  ...
                  options: {
                    tooltips: {
                      callbacks: {
                        label: function(tooltipItem, data) {
                          var datasetLabel = data.datasets[tooltipItem.datasetIndex].label || '';
                          return datasetLabel + ' : ' + tooltipItem.yLabel + ' ';
                        }
                      }
                    }
                  }
                  ...
                  

                  这篇关于在哪里放置“multiTooltipTemplate"在 Chart.js v2.x 中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:Angular2 用标签更新 ng2-charts 下一篇:如何更改 Chart.js 中使用的插值器?

                  相关文章

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

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

                  1. <legend id='tBYv4'><style id='tBYv4'><dir id='tBYv4'><q id='tBYv4'></q></dir></style></legend>
                  2. <tfoot id='tBYv4'></tfoot>

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