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

fix(charts): Expose chart object #472

Merged
merged 1 commit into from
Oct 27, 2016

Conversation

anthony-pinskey
Copy link
Contributor

  • Add exportAs directive decorator property
  • Update chart and ctx properties to public

- Add exportAs directive decorator property
- Update chart and ctx properties to public
@valorkin valorkin merged commit e46b5d1 into valor-software:development Oct 27, 2016
@FollonSaxBass
Copy link

FollonSaxBass commented Nov 13, 2016

I cant understand how to have the reference to che object using this commit, can you share the code to get the reference in my component? Now my reference isnt working.

chart.components.ts:

import {
    Component, OnInit, Input, Injector, ViewChild
} from '@angular/core';
import {DataService, User, Oggetto, Colonna, Valore} from "../../data.service";
import 'rxjs/Rx';

@Component({
    selector: 'chart',
    templateUrl: './app/plot/chart/chart.component.html'
})

export class ChartComponent implements OnInit {
    @ViewChild("baseChart") chartComp;
    colonne: Colonna[] = []
    rangeValues: number[] = [0, 1];
    chartMin = 0
    chartMax = 1
    // @Input()
    selectedUser: User;
    // @Input()
    selectedObject: Oggetto;
........
.......
.....
}

chart.component.html:

<div class="panel panel-default col-lg-8">
    <div class="panel-body">
        <div class="row">
            <div class="col-md-11">
                <div style="display: block;">
                    <canvas baseChart
                            [datasets]="lineChartData"
                            [labels]="lineChartLabels"
                            [options]="lineChartOptions"
                            [colors]="lineChartColors"
                            [legend]="lineChartLegend"
                            [chartType]="lineChartType"
                            (chartHover)="chartHovered($event)"
                            (chartClick)="chartClicked($event)"></canvas>
                </div>
            </div>

        </div>
        <div>
            <div>
                <p-slider [(ngModel)]="rangeValues" [range]="true" [min]="chartMin" [max]="chartMax"
                          (onSlideEnd)="onSlideEnd($event)"></p-slider>
            </div>
            <div><h4 style="float: left;">Range: {{lineChartLabelsTotal[rangeValues[0]]}}</h4><h4 style="float: right;">
                {{lineChartLabelsTotal[rangeValues[1]]}}</h4></div>
        </div>
    </div>
</div>

valorkin pushed a commit that referenced this pull request Dec 16, 2016
- Add exportAs directive decorator property
- Update chart and ctx properties to public
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants