sgratzl / chartjs-chart-pcp

Chart.js Parallel Coordinates Plot
https://www.sgratzl.com/chartjs-chart-pcp/
MIT License
19 stars 2 forks source link

How to color/highlight a single dataset? #65

Closed lunartec closed 1 day ago

lunartec commented 3 days ago

I am struggling to find any means/documentation around being able to highlight a single dataset a different colour.

Screenshot 2024-06-26 at 12 02 21

Context

Additional context

I have a "core" dataset that I want to map on top of "similar" datasets and I need to highlight this particular line.

lunartec commented 3 days ago

As an update, the hover function is able to do this, I can programmatically set an active dataset but then the next hover will remove this - and I don't really want to use the hover style, I would rather be able to specify a datasetIndex and then set a border-color, I am guessing for each lineSegment?

lunartec commented 3 days ago

UPDATE AGAIN: borderColor is indexable so using an array got me there 👍 looks like thats the way to go.

sgratzl commented 1 day ago

you should also be able to provide a function instead of an array if that is easier for you