
class Bar {
String name;
int value;
public Bar(String name,int value) {
this.name=name;
this.value=value;
}
}
class Point{
public Point(float x,float y) {
this.x=x;
this.y=y;
}
float x;
float y;
}
import java.awt.*;
import java.awt.geom.AffineTransform;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.FileOutputStream;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import javax.imageio.ImageIO;
public class LineChartMaker {
private int width;
private int height;
private BufferedImage img;
private Graphics2D g2d;
private int yStart;
private int yEnd;
private List<Bar> bars;
public LineChartMaker(int width, int height, int yStart, int yEnd){
this.width = width;
this.height = height;
this.img = new BufferedImage(this.width,this.height,BufferedImage.TYPE_INT_RGB);
this.g2d = (Graphics2D)img.getGraphics();
this.yStart = yStart;
this.yEnd = yEnd;
}
public void addBar(String name, int value) {
if(bars == null) {
bars = new ArrayList<Bar>();
}
bars.add(new Bar(name, value));
}
private void resetCoordinate() {
AffineTransform trans = new AffineTransform();
trans