0

In my angular2 application I'm using zingchart to display several charts. In all the examples i saw, this is how they display charts:

<code>
 <zingchart *ngFor="let chart of charts" [chart]="chart"></zingchart>
</code>

but what if i want to display each chart separately? i want to put a button between first chart and second chart. how can i do that? i need something like:

<code>
<zingchart  [chart]="charts[0]"></zingchart>
</code>

thanks in advance.

user6617577
  • 17
  • 1
  • 7

1 Answers1

0

You could do something like this, so for each chart in charts display the chart and a corresponding button, all nicely wrapped up in a div for styling.

<div *ngFor="let chart of charts">
   <zingchart [chart]="chart"></zingchart>
   <button type="button">Click Me!</button>
</div>

You could even wrap each chart it a custom component containing all the necessary items in one area.

Parent Component

<div *ngFor="let chart of charts">
    <customcomponent [chart]="chart"></customcomponent>
</div>

Child Component

<zingchart [chart]="chart"></zingchart>
<button type="button">Click Me!</button>

Hope that helps.

Oliver Cooke
  • 1,059
  • 1
  • 8
  • 22