angular2 + wijmo5 - Annotation Line

180 Views Asked by At

How can a plot a probability distribution chart in my Angular 2 application.

I tried using the wijmo annotation line. It worked using start and end point coordinates.
I need to plot the line using x-y data coordinate points.

Also tried attachment property with the wj-flex-chart-annotation-line (DataIndex, and DataCoordinate). How I need to specify data points with the attachment option. What is the value needed to provide with the data type point with attachment option?

<wj-flex-chart [itemsSource]="data" [chartType]="'Spline'" [bindingX]="'country'">

    <wj-flex-chart-axis [wjProperty]="'axisX'" [title]="titleX" [labels]="false"></wj-flex-chart-axis>
    <wj-flex-chart-axis [wjProperty]="'axisY'" [title]="titleY"></wj-flex-chart-axis>

    <wj-flex-chart-series [binding]="'sales'"></wj-flex-chart-series>

    <wj-flex-chart-annotation-layer>
        <wj-flex-chart-annotation-line [position]="2" [start]="{x: 250, y: 0}" [end]="{x: 250, y: 300}" ></wj-flex-chart-annotation-line>        
        <wj-flex-chart-annotation-line [attachment]="'DataIndex'" [wjProperty]="'axisX'" [pointIndex]="2"></wj-flex-chart-annotation-line>
    </wj-flex-chart-annotation-layer>
</wj-flex-chart>

data = [
  {'country': "US", 'downloads': 3457, 'sales': 1681.374337182966}, 
  {'country': "Germany", 'downloads': 467, 'sales': 5821.869030096296}, 
  {'country': "UK", 'downloads': 12151, 'sales': 2260.865004748749}, 
  {'country': "Japan", 'downloads': 19762, 'sales': 2331.3376444697155}, 
  {'country': "Italy", 'downloads': 13341, 'sales': 6264.880417785565}, 
  {'country': "Greece", 'downloads': 1088, 'sales': 80.409117985476}
];

Reference links used are:

Angular 2 Chart Annotation

WjFlexChartAnnotationLine Class

Thank You.

0

There are 0 best solutions below