Scatter not plotting X-Axis together with Line Chart in chartjs

Viewed 17

i have trouble in my code right here. When i use two different chart type, it only plots the y axis, but when I use only scatter type of chart it gets it right but the chart that is supposed to be a line chart do not plot any data at all. Here is my code.

var ctx11 = document.getElementById('nineChart2');
var nineChart2data1 = [bzvaqxnufhyd1.value, bzvaqxnufhyd2.value, bzvaqxnufhyd3.value, bzvaqxnufhyd4.value, bzvaqxnufhyd5.value, bzvaqxnufhyd6.value, bzvaqxnufhyd7.value];
var nineChart2data2 = [0, 1385.27, 1959.07, 2399.36, 2770.54, 3097.56, 3393.21];
var dps = [];
var adps = [];
var bdps = [];
var cdps = [];
var ddps = [];
var edps = [];
var nineChart2 = new Chart(ctx11, {
    data: {
        // labels: ['0', '1500', '2000', '2500', '3000', '3500', '4000'],
        labels: ['', '', '', '', '', '', ''],
        datasets: [{
            type: 'line',
            fill: false,
            label: ["MODEL 20T"],
            backgroundColor: 'red',
            borderColor: 'red',
            data: [{
                x: nineChart2data1,
                y: nineChart2data2
            }]
        }, {
            type: 'scatter',
            fill: false,
            label: '1',
            label: ["Duty Point 1"],
            backgroundColor: 'blue',
            borderColor: 'blue',
            borderWidth: 1,
            showLine: false,
            pointStyle: 'triangle',
            data: [{
                dataPoints: dps
            }]
        }, 

I tried adding xAxisid but i got a lot of error. This is the screenshot of my problem. The scatter and the line chart do not plot on the X axis, I tried inputting a value of 10 for my x axis. This is the screenshot Thank you for helping.

0 Answers
Related