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

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

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

      1. <tfoot id='BN8T2'></tfoot>

        如何在 chart.js 或 D3 中制作阶梯线或阶梯图?

        How can I make a stepline or stepped chart in chart.js or D3?(如何在 chart.js 或 D3 中制作阶梯线或阶梯图?)
          <bdo id='fuUMP'></bdo><ul id='fuUMP'></ul>
          <tfoot id='fuUMP'></tfoot>
        • <small id='fuUMP'></small><noframes id='fuUMP'>

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

              1. <legend id='fuUMP'><style id='fuUMP'><dir id='fuUMP'><q id='fuUMP'></q></dir></style></legend>
                    <tbody id='fuUMP'></tbody>

                  本文介绍了如何在 chart.js 或 D3 中制作阶梯线或阶梯图?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我可以在 Google 电子表格中完成此操作,以下是屏幕截图:

                  I'm able to accomplish this in Google Spreadsheets, below is a screenshot:

                  这是 CSV 中的小数据集

                  Here's the small dataset in CSV

                  Buy PPU,Sell PPU,Net PPU
                  0.023,0.019,-0.000725
                  0.026,0.0165,-0.003725
                  0.021,0.021,0.00735
                  0.015,0.0165,0.0147
                  0.021,0.028,0.0168
                  0.018,0.028,0.0198
                  

                  • jsFiddle 基本配置:http://jsfiddle.net/kaatula/j3FJf/1/
                  • Chart.js 文档:http://www.chartjs.org/docs/李>
                  • D3 文档:http://strongriley.github.io/d3/api/
                  • 感谢任何帮助.我在任何一个库中都没有看到这种特定类型图表的示例(称为我相信步进"或步进线"),但我相信它们足够灵活来完成这个?

                    Any help is appreciated. I'm not seeing an example in either library of this specific kind of chart (called I believe "Stepped" or "Step line"), but I believe they are flexible enough to accomplish this?

                    谢谢

                    推荐答案

                    似乎没有人回答这个问题,但是您可以通过在数据集配置中设置 steppedLine: true 来使用 chart.js 做到这一点.

                    Nobody seem to have answered this, but you can do that with chart.js by setting steppedLine: true in the dataset configuration.

                    var config = {
                            type: 'line',
                            data: {
                                datasets: [{
                                    label: "My dataset",
                                    data: [randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor()],
                                    steppedLine: true,
                                }
                       }
                    

                    这篇关于如何在 chart.js 或 D3 中制作阶梯线或阶梯图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  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 栏中隐藏值)
                  <tfoot id='1rftG'></tfoot>
                • <i id='1rftG'><tr id='1rftG'><dt id='1rftG'><q id='1rftG'><span id='1rftG'><b id='1rftG'><form id='1rftG'><ins id='1rftG'></ins><ul id='1rftG'></ul><sub id='1rftG'></sub></form><legend id='1rftG'></legend><bdo id='1rftG'><pre id='1rftG'><center id='1rftG'></center></pre></bdo></b><th id='1rftG'></th></span></q></dt></tr></i><div id='1rftG'><tfoot id='1rftG'></tfoot><dl id='1rftG'><fieldset id='1rftG'></fieldset></dl></div>

                  • <small id='1rftG'></small><noframes id='1rftG'>

                      <tbody id='1rftG'></tbody>

                    <legend id='1rftG'><style id='1rftG'><dir id='1rftG'><q id='1rftG'></q></dir></style></legend>

                      • <bdo id='1rftG'></bdo><ul id='1rftG'></ul>