Line color based on value
See original GitHub issueIs your feature request related to a problem? Please describe. I couldn’t find a way to set color on line based on value. I’d really like to set a different color on the line when it’s below zero.
Describe the solution you’d like Set the color as a function with value as parameter.
Describe alternatives you’ve considered
const color = value => value >= 0 ? "#00ff00" : "#ff0000";
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Excel: Change the row color based on cell value - Ablebits
How to change a row color based on a number in a single cell · Create a new formatting rule by clicking Conditional...
Read more >Change chart color based on value in Excel - ExtendOffice
Select the bar chart or column chart, then click Kutools > Charts > Color Chart by Value. Then in the popped-out dialog, set...
Read more >How to Change Line Chart Color Based on Value - ExcelNotes
Step 5: Now the Line chart is colored based on value. Step 6: Part of the line is gray, to change it to...
Read more >Highlight Rows Based on a Cell Value in Excel (Conditional ...
Click the 'Format' button. In the dialog box that opens, set the color in which you want the row to get highlighted. Click...
Read more >Power bi change color based on value [With 13 real examples]
Power BI changes data label color based on the value · Now, Select the Format style as Rules and choose the column field...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi,
I’m able to get this kind of charts using apexcharts. I guess that’s what you’re looking for :
First, I’ve a variable “data” containing all the values I will display on the chart. With that, I’ve created a function :
and my options looks like this :
Hope that can help !
I assume you’re talking about a line like this
Unfortunately, the line chart doesn’t currently support having a different color based on value. Hence, providing dataPointIndex will serve no purpose here.