question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[legendPosition]="below" is not working in charts which provide this property

See original GitHub issue

I’m submitting a … (check one with “x”)

  • bug report - search github for a similar issue or PR before submitting
  • feature request
  • support request - use StackOverflow (add the ngx-charts tag) or the gitter chat for support questions

Current behavior

After providing the [legendPosition]=“below”, it get this properties in my template however it doesn’t reflect on my UI. The legends still stay in the default position.

Expected behavior

As per the value provided to the [legendPosition] property, it should place the legends to the repective position with repect the graph.

Reproduction of the problem

  • create a template with simple angular app
  • add any chart which has [legendPosition] property supported
  • add [legendPosition]=“below”
  • run your application

What is the motivation / use case for changing the behavior?

  • stock market graphs
  • business KPI graphs
  • Business Analytics Graphs

Please tell us about your environment:

  • ngx-charts version: 8.0.2
  • Angular version: 7.2.1
  • Browser: [ Chrome XX ]
  • Language: [all | TypeScript 2.7 | ES6/7 | ES5]

Screenshots of code with the proper output is attached below:

original screenshot from 2019-01-18 14-18-16

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
upesh-mpcommented, May 29, 2021

In your component file , declare a variable as below = LegendPosition.below then in your template code, [legendPosition]="below"

1reaction
rafagsiqueiracommented, Jun 14, 2021

Small correction: LegendPosition.Below it appears. In the example grouped horizontal bar chart, I have noticed that schemeType also does not accept a string. It seems to accept enum ScaleType now as well.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Angular ngx-charts options for customizing the Legend?
The only options for legendPosition are 'right' (default) and 'below'. Rename Legend Fields. There don't seem to be options for customizing the ...
Read more >
Legend | Chart.js
When using the 'chartArea' option the legend position is at the moment not configurable, it will always be on the left side of...
Read more >
legend - Sets Legend Properties | CanvasJS Charts
Legend items/entries are stacked vertically (vertical orientation) when it displayed to the right or left of plotArea and horizontally (horizontal orientation) ...
Read more >
Show or hide a chart legend or data table - Microsoft Support
Select a chart and then select the plus sign to the top right. Point to Legend and select the arrow next to it....
Read more >
Configure Legend - FusionCharts
Legends are not applicable to single series charts. In the following image, the legend rendered below the x-axis helps identify the data plots...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found