swimlane / ngx-charts

:bar_chart: Declarative Charting Framework for Angular
https://swimlane.github.io/ngx-charts/
MIT License
4.28k stars 1.15k forks source link

setting ngx charts y axis to right side & weird angular selector #1037

Open udaykumar99 opened 5 years ago

udaykumar99 commented 5 years ago

I am building an area chart using ngx-charts, my requirement is to have y-axis on the right side rather than left.

Now going through that you have made yOrient property as an input(). I just can't figure out how to use this because of a weird selector which is

selector: 'g[ngx-charts-y-axis]', @Input() yOrient: string = 'left'; I am a novice to angular and just cant any information regarding this sort of selector. How do I pass data to this selector and where either in component or template? Any help would be highly appreciated

udaykumar99 commented 5 years ago

Ok did some progress and found that this weird selector is actually a SVG group selector ,this is where I stand In html: <svg:g ngx-charts-y-axis [yOrient]="yOrientRight"

</svg:g> In component yOrientRight = "right";

Is there anything that further needs to be done as the y-axis remains on left itself

vanyabrucker commented 2 years ago

Hi there :)

This is an old question, but the yOrient property is not exposed. What ngx-charts allow you to do is create custom charts. I'd recommend creating a custom chart (https://swimlane.gitbook.io/ngx-charts/custom-charts).

Full answer on Stackoverflow.

Hope this helps!