Create dashed line based on condition
See original GitHub issueHey, folks!
Is there a way to use conditions do change the strokeDash
on a line chart?
I have a dataframe w/ some projections for 2020, including (1) a baseline scenario and (2) several other stressed scenarios. I’d like to plot them on a single chart (that is, one line per scenario), and highlight the baseline one by making it dashed. Is it possible?
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
matplotlib - dashed line between points if one condition is met
I am using matplotlib to draw a plot.
Read more >How to create a conditional dashed line? - Qlik Community
I want the line to change to a dashed line when it becomes budgetted data. I can't find what the code is for...
Read more >How to Add Dotted Lines to Line Graphs in Microsoft Excel
Click Twice to Edit Pieces of the Line You would click on the dot in this screenshot, for example, to edit just the...
Read more >How to plot a dashed line in matplotlib? - GeeksforGeeks
To plot the dashed line we will create the dataset and then we use the above syntax to plot dashed datapoints.
Read more >Chart with Actual Solid Lines and Projected Dashed Lines
This tutorial shows how to create a chart with actual and projected data, with actual data formatted with a solid line and projected...
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 Free
Top 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
@ethanabrooks You can see an example of the syntax vega-lite required for multiple comparison at the end of this page in the docs. For altair to create the same expression you need to use
(alt.datum.symbol == 'GOOG') | (alt.datum.symbol == 'AMZN')
as the condition. You could also manually type out the comparison dictionary instead of using alt.condition to generate it as shown here.I’m just curious (and I can start a new issue if you prefer) but how would you get two lines to show up dashed? When I use
Only GOOG gets the dash.