Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

startAngle not working on PolarChart #4093

Closed
hankolehel opened this issue Mar 30, 2017 · 2 comments
Closed

startAngle not working on PolarChart #4093

hankolehel opened this issue Mar 30, 2017 · 2 comments

Comments

@hankolehel
Copy link

So I decided to use the PolarChart for my data visualizing project and wanted to rotate the chart to the left by 45 degrees.
After a lot of time researched on the internet I have concluded that this should work perfectly fine


<div>
  <div style="display: block">
    <canvas baseChart
            [data]="polarAreaChartData"
            [labels]="polarAreaChartLabels"
            [legend]="polarAreaLegend"
            [options]="polarChartOptions"
            [chartType]="polarAreaChartType"
            (chartHover)="chartHovered($event)"
            (chartClick)="chartClicked($event)"></canvas>
  </div>
  <button (click)="randomize()">Update</button>
</div>

This is my Angular2 file, declaring polarChartOptions, where I would follow up on further customizing it.

import { Component, OnInit } from '@angular/core';
import { PostsService } from '../posts.service';

@Component({
  selector: 'app-posts',
  templateUrl: './posts.component.html',
  styleUrls: ['./posts.component.css']
})
export class PostsComponent implements OnInit {

 // PolarArea
  public polarAreaChartLabels:string[] = ['A','B','C','D','E','F','G','H', 'I'];
  public polarAreaChartData:number[] = [100, 80, 110, 20, 20, 20, 20, 20, 20];
  public polarAreaLegend:boolean = true;

  public polarAreaChartType:string = 'polarArea';

  public polarChartOptions:any = {
      startAngle: 90,
      legend: false
    };

  // events
  public chartClicked(e:any):void {
    console.log(e);
  }

  public chartHovered(e:any):void {
    console.log(e);
  }


  constructor(private postsService: PostsService) { }

  }
}

Any help would be greatly appreciated.

@hankolehel
Copy link
Author

Quick note: the


  public polarChartOptions:any = {
      startAngle: 90,
      legend: false
    };

the legend: false is working as intented

@etimberg
Copy link
Member

@hankolehel this definitely works in v2.5 https://jsfiddle.net/8qu0xk1r/
What version are you using under the hood?

Also, the startAngle property is in radians, not degrees and defaults to -0.5 * Math.PI (ie 0 is along the horizontal axis of the screen)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants