Charts 如何在chartjs中显示两条重叠线

Charts 如何在chartjs中显示两条重叠线,charts,chart.js,Charts,Chart.js,我正在尝试创建一个包含多个数据集的折线图, 但对于某些数据集,值有可能匹配,在这种情况下,线重叠并显示首先定义的集,此时绿色和红色重叠,绿色首先定义,因此显示其颜色 img-> })) 我希望重叠的线条显示两种颜色您可以尝试将颜色设置为半透明。例如,代替绿色使用rgb(0128,0,0.5) var chart = new Chart(ctx, { // The type of chart we want to create type: 'line', // also try bar or ot

我正在尝试创建一个包含多个数据集的折线图, 但对于某些数据集,值有可能匹配,在这种情况下,线重叠并显示首先定义的集,此时绿色和红色重叠,绿色首先定义,因此显示其颜色

img->

}))


我希望重叠的线条显示两种颜色

您可以尝试将颜色设置为半透明。例如,代替绿色使用
rgb(0128,0,0.5)

var chart = new Chart(ctx, {
// The type of chart we want to create
type: 'line', // also try bar or other graph types

// The data for our dataset
data: {
    labels: $.getMonths(year+'-01-01',year+'-12-31'),
    // Information about the dataset
datasets: [
    {
        label: "Converted",
        borderColor: 'Green',
        data: leadsConvertedAtCountPerMonthPerYear,

    },
    {
        label: "Contacted",
        borderColor: 'red',
        data: leadsContactedAtCountPerMonthPerYear,

    },
    {
        label: "Assigned",
        borderColor: 'royalblue',
        data: leadsAssignedAtCountPerMonthPerYear,

    },


]
},

// Configuration options
options: {
layout: {
  padding: 10,
},
    legend: {
        position: 'bottom',
    },
    title: {
        display: true,
        text: 'Reports for '
    },
    scales: {
        yAxes: [{
            scaleLabel: {
                display: true,
                labelString: 'Precipitation in mm'
            }
        }],
        xAxes: [{
            scaleLabel: {
                display: true,
                labelString: 'Month of the Year'
            }
        }]
    }
}