Skip to content

Unable to set different line colors based on marker values and color in chart js line graph #11204

Closed
@ttvettuparambil

Description

@ttvettuparambil

Expected behavior

The line chart should render with the line color changing based on the marker colors.
This is an example screenshot of what the output should be.
https://pasteboard.co/6PKRCJzsaKa6.png
Currently the code that I have written using chart JS (v 4.2.1) is not rendering in the browser.
I am trying to do this using vanilla javascript. I am welcome to any suggestions. If there is an alternate method, kindly suggest it to me also.

Current behavior

The code is not rendering in the frontend and the there is error in console window. (screenshot attached below.)
https://pasteboard.co/Rma2XuY1jAz7.png

Reproducible sample

https://codepen.io/Thomas-1/pen/oNPVqQp

Optional extra steps/info to reproduce

No response

Possible solution

No response

Context

This is an example screenshot of what I am trying to achieve.
https://pasteboard.co/HgPrWMUziKIS.png

chart.js version

v4.2.1

Browser name and version

Microsoft Edge Version 111.0.1661.44 (Official build) (64-bit)

Link to your project

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions