小编Sam*_*ver的帖子

Chart.js - 用X,Y坐标绘制折线图

我正在尝试用x,y坐标创建一个简单的折线图,但我得到一个空白页面.

我不想设置标签,但要从x,y坐标自动生成标签.我认为chartjs已经实现了,但我的语法错了.

var x = new Chart(document.getElementById("myChart1"), {
    type: 'line',
    data: {
        datasets: [{
            label: "Test",
            data: [{
                x: 0,
                y: 5
            }, {
                x: 5,
                y: 10
            }, {
                x: 8,
                y: 5
            }, {
                x: 15,
                y: 0
            }],
        }]
    },
    options: {
        responsive: true,
    }
});
Run Code Online (Sandbox Code Playgroud)

知道如何修复上面的代码吗?

javascript chart.js

14
推荐指数
1
解决办法
1万
查看次数

Bootstrap 4 - 粘性页脚 - 动态页脚高度

我需要把一个棘手的页脚我的网页上,但我没有一个明确的高度,我的页脚设置.在较小的屏幕上 - 行调整大小,页脚变长.

因此,getbootstrap上提供的默认粘性页脚示例不起作用,因为它需要固定的页脚高度.

有没有办法实现这个?

/* Sticky footer styles
-------------------------------------------------- */
html {
  position: relative;
  min-height: 100%;
}
body {
  /* Margin bottom by footer height */
  margin-bottom: 60px;
}
.footer {
  position: absolute;
  bottom: 0;
  width: 100%;
  /* Set the fixed height of the footer here */
  height: 60px;
  line-height: 60px; /* Vertically center the text there */
  background-color: #f5f5f5;
}


/* Custom page CSS
-------------------------------------------------- */
/* Not required for template or sticky footer method. */

body > …
Run Code Online (Sandbox Code Playgroud)

html css sticky-footer twitter-bootstrap bootstrap-4

3
推荐指数
2
解决办法
7514
查看次数

Laravel - 如何每分钟运行一个函数/控制器?(任务调度)

我有一个控制器方法,我想每分钟运行一次。我阅读了任务计划的文档,但它似乎只记录了命令。

有什么方法可以使用它每分钟调用路由/控制器方法/脚本吗?

<?php

namespace App\Http\Controllers;

use App\Http\Controllers\Controller;
use App\Acc;

class ScriptController extends Controller
{
    public function updateAcc()
    {
        $c = new Scripts\AccountA();
        $xoo = $c->getInfo();
        $z = json_decode($xoo,true);

        $data= new Acc();
        $data->price = $z["result"];
        $data->save();
    }
}
Run Code Online (Sandbox Code Playgroud)

我需要使用数据库外观外部类等......

php cron laravel laravel-5

3
推荐指数
1
解决办法
8701
查看次数