MATSim uses the JFreeChart library to generate charts (see http://www.jfree.org/jfreechart/ for additional information). The library is somewhat complex to understand, but we have included the most useful tools in:
org.matsim.core.utils.chartsA simple chart may be created like this:
public class MyChartCreator {
public static void main(String[] args) {
XYLineChart chart = new XYLineChart("Title","x-axis","y-axis");
chart.addSeries("SeriesTitle", new double[]{1.0,2.0,2.4}, new double[]{1.0,2.0,4.0});
//adds a Series to the chart
charta.saveAsPng("a-chart.png", 800, 600); //File Export
}
}
Now, try to use a chart in your EventHandler:
Try to collect the number of vehicles on link 6 per hour and write them to a chart.
You will find the solution in MyEventHandler3.