ngx-charts
ngx-charts copied to clipboard
Reference Lines in Bar chart
Originally posted by @marjan-georgiev in https://github.com/swimlane/ngx-charts/pull/422#issuecomment-309456263
This would be an awesome feature!
Yes, absolutely. Any idea when this is coming? The research project I'm working on requires background reference lines in bar graphs. I'm certain that this feature would make a number of people very happy.
I implemented this feature locally a while ago, because I needed it so much, I can do a PR with these modifications

@AlisonVilela I would love to see a PR for this, or just your implementation would also be very helpful! Thanks in advance
any updates on this?
@AlisonVilela can you please post your solution?
@AlisonVilela would you mind sharing your implementation ?
I faced the same issue. My solution might not be the cleanest but it worked. You can create a new component and copy the ngx-bar-chart component from the ngx-charts-Module into it.
Then add the following 3 lines to the ngx-charts-y-axis
:
[referenceLines]="referenceLines"
[showRefLines]="showRefLines"
[showRefLabels]="showRefLabels"
Thanks kolya-kra I just did this with stacked bar chart and works like a charm. If somebody need it I can send more info.
Can we support this?
@EvaristoPerez hi can you please share what you did? We are running into the same problem. thanks!
@EvaristoPerez Hi, is there any repo where we can check it out ? or at least any guide? Thanks
@kolya-kra Hi, Can you share any progress or support us with a guide pls? Thanks!
Hi, @EvaristoPerez and @kolya-kra! Is it possible for you to share a gist with the code? Many thanks!
Hi, is there any possibility to get a PR? @AlisonVilela
We've published a version of ngx-charts that includes @kedij777's reference line support. You can use it by installing @bugsplat/[email protected]
.