*
*/
public Object createObject(Attributes atts) throws JRException
{
// Grab the chart from the object stack.
JRDesignChart chart = (JRDesignChart)digester.peek();
// Set the text color
String attrValue = atts.getValue(JRXmlConstants.ATTRIBUTE_textColor);
if (attrValue != null && attrValue.length() > 0)
{
Color color = JRColorUtil.getColor(attrValue, null);
chart.setLegendColor(color);
}
// Set the background color
attrValue = atts.getValue(JRXmlConstants.ATTRIBUTE_backgroundColor);
if (attrValue != null && attrValue.length() > 0)
{
Color color = JRColorUtil.getColor(attrValue, null);
chart.setLegendBackgroundColor(color);
}
EdgeEnum position = EdgeEnum.getByName(atts.getValue(JRXmlConstants.ATTRIBUTE_position));
if (position != null)
{
chart.setLegendPosition(position);
}
// Any font set will be put in the chart directly by the digester
return chart;
}