<legend id='OgHAX'><style id='OgHAX'><dir id='OgHAX'><q id='OgHAX'></q></dir></style></legend>
  1. <tfoot id='OgHAX'></tfoot>
      • <bdo id='OgHAX'></bdo><ul id='OgHAX'></ul>

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

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

      Chart.js t.ticks.map 不是函数

      时间:2023-11-02

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

        <tbody id='FIqPX'></tbody>
    2. <tfoot id='FIqPX'></tfoot>
          <bdo id='FIqPX'></bdo><ul id='FIqPX'></ul>

            1. <i id='FIqPX'><tr id='FIqPX'><dt id='FIqPX'><q id='FIqPX'><span id='FIqPX'><b id='FIqPX'><form id='FIqPX'><ins id='FIqPX'></ins><ul id='FIqPX'></ul><sub id='FIqPX'></sub></form><legend id='FIqPX'></legend><bdo id='FIqPX'><pre id='FIqPX'><center id='FIqPX'></center></pre></bdo></b><th id='FIqPX'></th></span></q></dt></tr></i><div id='FIqPX'><tfoot id='FIqPX'></tfoot><dl id='FIqPX'><fieldset id='FIqPX'></fieldset></dl></div>
              • <legend id='FIqPX'><style id='FIqPX'><dir id='FIqPX'><q id='FIqPX'></q></dir></style></legend>
                本文介绍了Chart.js t.ticks.map 不是函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                结果和标签都来自服务器,但它们看起来没问题.当我运行此代码时,我没有得到任何图形.我正在使用 CDN 中的 chart.js.

                Both results and labels come from the server but they seem alright. When I run this code I don't get any graphics. I'm using the chart.js from the CDN.

                澄清一下,结果和数据都来自代码.它们没有像示例中那样进行硬编码.

                Clarification, both results and data come from the code. They are not hardcoded as they look in the example.

                我得到的错误说:

                t.ticks.map 不是函数

                t.ticks.map is not a function

                无法获取未定义或空引用的属性跳过"

                Unable to get property 'skip' of undefined or null reference

                代码:

                <canvas id="myChart" width="400" height="400"></canvas>
                var ctx = document.getElementById("myChart").getContext("2d");
                var result = [0, 0, 0];
                var lbls = ['A', 'B', 'C'];
                var myChart = new Chart(ctx, {
                    type: 'line',
                    data: {
                        labels: lbls.split(','),
                        datasets: [{
                            label: '# of Votes',
                            data: result
                        }]
                    }
                });
                

                也欢迎任何关于其他图表实用程序的建议.

                Any suggestion about another chart utility is welcome too.

                推荐答案

                标签需要一个数组变量,但是 var lbls = $('#lbls').html() 返回一个字符串,所以用 ',' 分开就可以了

                The labels requires a array variable but the var lbls = $('#lbls').html() returns a string so splitting it with ',' will do the job

                var myChart = new Chart(ctx, {
                type: 'line',
                data: {
                    labels: lbls.split(','),
                    datasets: [{
                        label: '# of Votes',
                        data:  [20, 10]
                    }]
                }
                });
                

                这篇关于Chart.js t.ticks.map 不是函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                上一篇:(Vue, ChartJS) 从子组件画布上下文为图表创建渐变背景 下一篇:如何将光标样式更改为悬停在图表点上的指针?

                相关文章

                1. <small id='fih0q'></small><noframes id='fih0q'>

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

                    <tfoot id='fih0q'></tfoot>