public class AreaChartFactory extends LineChartFactory {
@Override
public LineChart getLineChartFromColumn( int col ) {
LineChart ac = null;
if ( linechartstyle != LineChart.Style.HOLLOW ) {
AreaLineChart ahc = new AreaLineChart();
ahc.setFill( getColor( col ) );
ac = ahc;
} else {
AreaHollowChart ahc = new AreaHollowChart();
ahc.setFill( getColor( col ) );
ac = ahc;
}
Number[] numbers = new Number[getRowCount()];
for ( int row = 0; row < getRowCount(); row++ ) {
numbers[row] = ( (Number) getValueAt( row, col ) ).doubleValue();
}
ac.addValues( numbers );
ac.setColour( getColor( col ) );
if ( linechartwidth != null ) {
ac.setWidth( linechartwidth );
}
if ( tooltipText != null ) {
ac.setTooltip( tooltipText );
}
// set the title for this series
ac.setText( getColumnHeader( col ) );
// set the onclick event to the base url template
if ( null != baseURLTemplate ) {
ac.setOn_click( baseURLTemplate );
}
if ( alpha != null ) {
ac.setAlpha( alpha );
}
return ac;
}