Forum Discussion
Add dynamic vertical reference line on bar chart
Hello,
I have hospital inpatient data that looks as follows:
| Patient ID | Pathology ID | Length of stay | Lower threshold for pathology | Upper treshold for pathology | Average length of stay for pathology |
| 758473 | A1 | 3 | 2 | 5 | 3.4 |
| 856473 | A1 | 4 | 2 | 5 | 3.4 |
| 338409 | A1 | 3 | 2 | 5 | 3.4 |
| 362738 | A1 | 5 | 2 | 5 | 3.4 |
| 274883 | A1 | 6 | 2 | 5 | 3.4 |
| 930950 | A1 | 4 | 2 | 5 | 3.4 |
| 284521 | A1 | 3 | 2 | 5 | 3.4 |
| 845637 | B2 | 2 | 1 | 3 | 1.7 |
| 884563 | B2 | 1 | 1 | 3 | 1.7 |
| 840112 | B2 | 1 | 1 | 3 | 1.7 |
Every pathology has a predetermined universal lower and uper threshold for the length of stay, meaning that a patient with a given pathology should have a length of stay no shorter than the lower threshold, and no longer than the upper threshold. There is also an average length of stay (a universal value unrelated to the dataset) for each pathology.
When analyzing the data in a bar chart for each pathology individually, I want to see what the tresholds are for the pathology and compare it to the patient distribution.
Here is what I have:
Here is what I want:
Each line represents one of the tresholds related to the selected pathology, or the average length of stay for the pathology (in the upper example, pathology A1 that has been selected).
This visual would enable me to easily visually identify the number of patients that are out of bounds.
Do you know how to add these lines to a bar chart? Or is there a custom visual? Or an R script that you could refer me to?
Thank you!
Kind regards
Hi ebhdlt ,
Unfortunately, it is currently not possible to add vertical reference lines to the bar chart. You can try the following ways to replace lines with bar. Please see the attachment for the specific model.
If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
WinnizIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
3 Replies
- amitchandakSuper User
ebhdlt , make sure x-axis of type continuous. Then in analytics Pane, you will get the option for A-axis Constant line
- ebhdltFrequent Visitor
amitchandak Unfortunately this does not work for the bar chart.
How do I place vertical lines on the x axis based on values that originate from another column that the one used by the x axis?
- v-kkf-msftCommunity Support
Hi ebhdlt ,
Unfortunately, it is currently not possible to add vertical reference lines to the bar chart. You can try the following ways to replace lines with bar. Please see the attachment for the specific model.
If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
WinnizIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.