Field Name | Field Type | Field Description |
---|---|---|
pieSize | integer | Number of data items in pie chart |
barSize | integer | Number of data items in bar chart |
lineSize | integer | Number of data items in line graph |
pieLabel[0] | String | First label for pie chart |
pieData[0] | double | First data value for pie chart |
pieLabel[1] | String | Second label for pie chart |
pieData[1] | double | Second data value for pie chart |
... | ||
pieLabel[pieSize-1] | String | Last label for pie chart |
pieData[pieSize-1] | double | Last data value for pie chart |
barData0 | double[barSize] | First data sequence for bar chart |
barData1 | double[barSize] | Second data sequence for bar chart |
lineData0 | double[lineSize] | First data sequence for line graph |
lineData1 | double[lineSize] | Second data sequence for line graph |
lineData2 | double[lineSize] | Third data sequence for line graph |
// Instantiation example Plotter pieChart = new Plotter("Chart Title");Now add the code to setup and display the pie chart, by calling the following methods that are implemented in the Plotter class:
// Enumeration public enum eType { PIECHART, BARCHART, LINEGRAPH }public void drawGraph(eType type);
pieChart.drawGraph(Plotter.eType.PIECHART);At this point your program should display the pie chart with the data from chart.txt.