首页 文章

在chart.js中显示图表上的网格线,在chart.js中显示粗体x轴标签,在chart.js中显示交叉图形颜色的混合

提问于
浏览
1

非常新的 chart.js . 对此有一些疑问,无法弄清楚如何 .

  • well i want my graph looks like as in the image below. image1.jpg

enter image description here

  • This is how i styled till now. image2.jpg

enter image description here

  • Required stylings.

  • 我不希望网格线在比例线后扩展,如 image1.jpg .

  • 自定义轴标签字体粗细 .

  • 网格线与 image1.jpg 中的图形重叠 .

  • 丰富的颜色混合,其中图形彼此重叠 . (它在那里,但不是 image1.jpg ) .

请帮忙解决这个问题 . 提前致谢 .

1 回答

  • 0

    生成图形后,

    const canvasmixedBarLine: any = document.getElementById('mixedBarLine');
    
    const ctxmixedBarLine: any = canvasmixedBarLine.getContext('2d');
    
    const mixedBarLine = new Chart(ctxmixedBarLine, {});
    

    尝试在此之后添加以下行:

    ctxmixedBarLine.globalCompositeOperation = 'destination-over';
    

相关问题