I just stuck on a problem. Let me first explane the problem.
Here it is: I need to create different types of charts on spreadsheet by fetching data from database. I have a spreadsheet which will contain one many sheets e.g.
1. Data Sheet: It will contain the data fetch from data base.
2. DataRange Sheet: It will contain the range of data filled in first sheet(data sheet). e.g. In cell
3. many sheets of different chart types. : e.g. Bar chart,Bar3DChart,PieChart,Line Chart, Area Chart, Bubble chart etc.
And these sheets will have currosponding chart templates also. But it will not have any set data reference becoz it will be generated dynamicaly.
I need to draw the the charts on the basis of data in first sheet.
The way I did it is just using a switch case with different chart type.
And create a function for each chart type. e.g. CreateBarChart(), CreatePieChart().
But I don't think its a good way of emplimentation.
Is there any generic way to create different types of charts. like factory patterns etc.
Please help me with some nice sample code.