ABPCMS.Web/lib/chart.js/samples/charts/line/interpolation-modes.html

(开头部分) 3KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

<!doctype html>
<html>

<head>
    <title>Line Chart - Cubic interpolation mode</title>
    <script src="../../../dist/Chart.bundle.js"></script>
    <script src="../../utils.js"></script>
    <style>
    canvas{
        -moz-user-select: none;
        -webkit-user-select: none;
        -ms-user-select: none;
    }
    </style>
</head>

<body>
    <div style="width:75%;">
        <canvas id="canvas"></canvas>
    </div>
    <br>
    <br>
    <button id="randomizeData">Randomize Data</button>
    <script>

        var randomScalingFactor = function() {
            return Math.round(Math.random() * 100);
        };

        var datapoints = [0, 20, 20, 60, 60, 120, NaN, 180, 120, 125, 105, 110, 170];
		var config = {
            type: 'line',
            data: {
                labels: ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"],
                datasets: [{
                    label: "Cubic interpolation (monotone)",
                    data: datapoints,
                    borderColor: window.chartColors.red,
					backgroundColor: 'rgba(0, 0, 0, 0)',
                    fill: false,
					cubicInterpolationMode: 'monotone'
                }, {
                    label: "Cubic interpolation (default)",
                    data: datapoints,
                    borderColor: window.chartColors.blue,
					backgroundColor: 'rgba(0, 0, 0, 0)',
                    fill: false,
                }, {
                    label: "Linear interpolation",
                    data: datapoints,
                    borderColor: window.chartColors.green,
					backgroundColor: 'rgba(0, 0, 0, 0)',
                    fill: false,
					lineTension: 0
                }]
            },
            options: {
                responsive: true,
                title:{
                    display:true,
后面还有 43 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。