plotly / plotly/react-plotly.js
How to change marker color for only some values in line graph?
Open
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 1.1k
- Forks
- 138
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 4
Description
I'm using the following code to create a line graph with markers. I'm able to customize markers with marker prop. But how can I dynamically change with respect to the value plotted? Please advice.
Eg: Value 8 will have different marker.

Code:
<Plot
data={[
{
x: [1, 2, 3, 4],
y: [3, 5, 8, 5],
type: 'scatter',
mode: 'lines+markers',
marker: {color: 'red'},
},
]}
layout={{width: 320, height: 240, title: 'A Fancy Plot'}}
/>
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Read the React <Plot> example and the scatter marker configuration first. Determine whether per-point marker colors are supported with mode: 'lines+markers'; done means documenting a working configuration for the value 8 or clearly stating the limitation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react
- Domain
- data-visualization
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100