Introduction

For this assignment you are to write a graphing application in Java. You will provide the user with a textfield into which they can enter a string of data, a combo-box which allows them to choose between different kinds of graphs (at a minimum, a bar chart, a line graph and a pie chart), and a button that interprets the data provided by the user in graph form. Users will provide data to the system in the form of a comma separated string such as “20,50,10,20,80”. Your application must convert this string into a suitable integer array, and then display the data in the graphing format chosen by the user like so:

  • Line Graph
  • Bar Chart
  • Pie Chart

For this assignment you are required to manually draw the graphics using the Graphics or Graphics2D library of Java. For the line graph you should use drawLine, for the bar chart you should use fillRect, and for the pie chart you should use fillArc.

Your graphs must cycle through colours for each significant element of data (you can assume a maximum of ten elements in a graph for this), and draw starting from the bottom left of the application. You should make an attempt to separate presentation from calculations within the application, and make use of good Swing design to handle the drawing of graphs.

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.