Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
74 views
in Technique[技术] by (71.8m points)

javascript - Jquery chartsjs plugin lines not working properly

im trying to using chartsjs to do a line chart.

new Chart(document.getElementById("myChart"), {
        type: 'line',
        data: {
            labels: ['GEN', 'FEB', 'MAR', 'APR', 'MAY', 'JUN', 'JUL', 'AUG', 'SEP', 'OCT', 'NOV', 'DEC'],
            datasets: [{
                data: [0, 10, 20, 30, 40, 50, 40, 30, 20, 10, 0, 15],
                label: "CDL",
                borderColor: "#3e95cd",
                fill: false
            }, {
                    data: [50, 50, 50, 50, 50, 50, 50, 50, 50, 50],
                label: "CLA",
                borderColor: "#8e5ea2",
                fill: false
            }, {
                    data: [10, 10, 10, 10, 10, 10, 10, 10, 10, 10],
                label: "CLB",
                borderColor: "#3cba9f",
                fill: false
            }, {
                data: [40, 20, 10, 16, 24, 38, 5, 7, 45, 0],
                label: "CLC",
                borderColor: "#e8c3b9",
                fill: false

            }
            ]
        },
        options: {
            responsive: false,
            scales: {
                yAxes: [{
                    stacked: true,
                    gridLines: {
                        display: true,
                        color: "rgba(255,99,132,0.2)"
                    }
                }],
                xAxes: [{
                    gridLines: {
                        display: true
                    }
                }]
            },
            legend: {
                labels: {
                    fontColor: 'black'
                }
            }
        }


    });

This is my code and it works, but my lines dont starting in "absolute position" and theyr position is like this: chart_image

I dont understand why, can someone help me?

question from:https://stackoverflow.com/questions/65830638/jquery-chartsjs-plugin-lines-not-working-properly

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...