public void addListener(ChartListener listener){
  if (listenerList == null) {
    listenerList=new ArrayList<ChartListener>();
  }
  listenerList.add(listener);
}

public void addListener ( ChartListener listener ) { if ( listenerList == null ) { listenerList = new ArrayList < ChartListener > ( ) ; } listenerList . add ( listener ) ; }
add a chart listener .
