Hi,
My requirement is to
1. Create a component which gives option to display any one of Line Chart, Stacked Bar, Pie Chart and Tree Map ( named as child component )
2. To create parent component which will use child component twice to display any 2 type charts.
How it is implemented :
1. Parent component will provide all data ( datasource, xName, yName, title etc. ) to child component
2. Child component will have button to switch to different chart types
Problem faced :
1. Both charts ( since child component is used twice inside parent component ) render properly first. But when both charts are set to same type and then any one chart is changed to another type then one of the chart disappears.
2. Tree Map is not responsive
Eg;
Chart 1: Line chart is selected for display
Chart 2 : Pie chart is selected for display
Step 1 : Chart 2 is changed to line chart ( Works fine )
Step 2 : Chart 1 is changed to stacked bar
on doing step 2, chart 1 is diplayed but chart 2 (stacked bar) disappears automatically
NOTE : Attached files
1. Final output : How it is displayed
2. ChartComponent.ts and chartComponent.html - Child Component
3. PieChartComponent.ts and .html - Parent Component
Attachment:
Attachment_91f2d8f9.zip