Home » Archived » BIRT » How to modify the value of legend
How to modify the value of legend [message #364348] |
Mon, 28 July 2008 22:53  |
Eclipse User |
|
|
|
Originally posted by: bo.ye.golferpass.com
hi all
The number in the legend by default shows the X-axis value. If I have to
customize the legend of the report egine JAVA code should be used, how to
achieve
thank you!
|
|
| |
Re: How to modify the value of legend [message #364395 is a reply to message #364380] |
Tue, 29 July 2008 22:22   |
Eclipse User |
|
|
|
Originally posted by: bo.ye.golferpass.com
hi
Jason
I use the report designer can achieve the functions I have to, but I do not
know how to use JAVA code to achieve. Example:
/*********************************************************** ************
* Copyright (c) 2004 Actuate Corporation.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Actuate Corporation - initial API and implementation
************************************************************ ***********/
package org.eclipse.birt.chart.examples.api.data.autobinding;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import org.eclipse.birt.chart.device.IDeviceRenderer;
import org.eclipse.birt.chart.exception.ChartException;
import org.eclipse.birt.chart.factory.Generator;
import org.eclipse.birt.chart.factory.IDataRowExpressionEvaluator;
import org.eclipse.birt.chart.factory.RunTimeContext;
import org.eclipse.birt.chart.integrate.SimpleDataRowExpressionEval uator;
import org.eclipse.birt.chart.model.Chart;
import org.eclipse.birt.chart.model.ChartWithAxes;
import org.eclipse.birt.chart.model.attribute.AxisType;
import org.eclipse.birt.chart.model.attribute.Bounds;
import org.eclipse.birt.chart.model.attribute.IntersectionType;
import org.eclipse.birt.chart.model.attribute.LegendBehaviorType;
import org.eclipse.birt.chart.model.attribute.LegendItemType;
import org.eclipse.birt.chart.model.attribute.Orientation;
import org.eclipse.birt.chart.model.attribute.Position;
import org.eclipse.birt.chart.model.attribute.ScaleUnitType;
import org.eclipse.birt.chart.model.attribute.TickStyle;
import org.eclipse.birt.chart.model.attribute.impl.BoundsImpl;
import org.eclipse.birt.chart.model.attribute.impl.ColorDefinitionI mpl;
import
org.eclipse.birt.chart.model.attribute.impl.JavaDateFormatSp ecifierImpl;
import org.eclipse.birt.chart.model.component.Axis;
import org.eclipse.birt.chart.model.component.Series;
import org.eclipse.birt.chart.model.component.impl.SeriesImpl;
import org.eclipse.birt.chart.model.data.Query;
import org.eclipse.birt.chart.model.data.SeriesDefinition;
import org.eclipse.birt.chart.model.data.impl.QueryImpl;
import org.eclipse.birt.chart.model.data.impl.SeriesDefinitionImpl;
import org.eclipse.birt.chart.model.impl.ChartWithAxesImpl;
import org.eclipse.birt.chart.model.layout.Legend;
import org.eclipse.birt.chart.model.layout.Plot;
import org.eclipse.birt.chart.model.type.BarSeries;
import org.eclipse.birt.chart.model.type.impl.BarSeriesImpl;
import org.eclipse.birt.chart.util.PluginSettings;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.PaintEvent;
import org.eclipse.swt.events.PaintListener;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Canvas;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import com.ibm.icu.util.ULocale;
/**
* The selector of charts in SWT.
*
*/
public final class AutoDataBindingViewer implements
PaintListener
{
private IDeviceRenderer idr = null;
private Chart cm = null;
private IDataRowExpressionEvaluator dree = null;
/**
* main() method for constructing the layout.
*
* @param args
*/
public static void main( String[] args )
{
Display display = Display.getDefault( );
Shell shell = new Shell( display );
shell.setSize( 600, 400 );
shell.setLayout( new GridLayout( ) );
Canvas cCenter = new Canvas( shell, SWT.NONE );
AutoDataBindingViewer adbv = new AutoDataBindingViewer( );
cCenter.setLayoutData( new GridData( GridData.FILL_BOTH ) );
cCenter.addPaintListener( adbv );
shell.open( );
while ( !shell.isDisposed( ) )
{
if ( !display.readAndDispatch( ) )
display.sleep( );
}
display.dispose( );
}
/**
* Get the connection with SWT device to render the graphics.
*/
AutoDataBindingViewer( )
{
final PluginSettings ps = PluginSettings.instance( );
try
{
idr = ps.getDevice( "dv.SWT" );//$NON-NLS-1$
}
catch ( ChartException ex )
{
ex.printStackTrace( );
}
cm = createSimpleChart( );
}
private static final Chart createSimpleChart( )
{
ChartWithAxes cwaBar = ChartWithAxesImpl.create( );
cwaBar.getInteractivity( )
.setLegendBehavior( LegendBehaviorType.HIGHLIGHT_SERIE_LITERAL );
// Plot
cwaBar.getBlock( ).setBackground( ColorDefinitionImpl.WHITE( ) );
cwaBar.getBlock( ).getOutline( ).setVisible( true );
Plot p = cwaBar.getPlot( );
p.getClientArea( ).setBackground( ColorDefinitionImpl.create( 255,
255,
225 ) );
// Legend
Legend lg = cwaBar.getLegend( );
// cwaBar.getLegend( ).setVisible( false );
lg.setItemType( LegendItemType.CATEGORIES_LITERAL );
lg.setPosition( Position.ABOVE_LITERAL );
lg.setOrientation(Orientation.HORIZONTAL_LITERAL);
// X-Axis
Axis xAxisPrimary = cwaBar.getPrimaryBaseAxes( )[0];
xAxisPrimary.setType( AxisType.TEXT_LITERAL );
xAxisPrimary.getOrigin( ).setType( IntersectionType.VALUE_LITERAL );
xAxisPrimary.getTitle( ).setVisible( false );
xAxisPrimary.setFormatSpecifier( JavaDateFormatSpecifierImpl.create(
"MM/dd/yyyy" ) );//$NON-NLS-1$
xAxisPrimary.setType( AxisType.DATE_TIME_LITERAL );
xAxisPrimary.getScale().setUnit(ScaleUnitType.WEEKS_LITERAL) ;
xAxisPrimary.getScale().setStepNumber(1);
xAxisPrimary.getLabel( )
.getCaption( )
.setColor( ColorDefinitionImpl.RED( ) );
xAxisPrimary.getLabel( ).getCaption( ).getFont( ).setRotation( -30 );
xAxisPrimary.getLabel().setVisible(true);
// Y-Axis
Axis yAxisPrimary = cwaBar.getPrimaryOrthogonalAxis( xAxisPrimary );
yAxisPrimary.getMajorGrid( ).setTickStyle( TickStyle.LEFT_LITERAL );
yAxisPrimary.setType( AxisType.LINEAR_LITERAL );
yAxisPrimary.getTitle( ).setVisible( false );
// X-Series
Series seCategory = SeriesImpl.create( );
Query query = QueryImpl.create( "Items" );//$NON-NLS-1$
seCategory.getDataDefinition( ).add( query );
SeriesDefinition sdX = SeriesDefinitionImpl.create( );
sdX.getSeriesPalette( ).shift( 0 ); // SET THE COLOR IN THE PALETTE
xAxisPrimary.getSeriesDefinitions( ).add( sdX );
sdX.getSeries( ).add( seCategory );
// Y-Series
BarSeries bs = (BarSeries) BarSeriesImpl.create( );
Query query2 = QueryImpl.create( "Amounts" );//$NON-NLS-1$
bs.getDataDefinition( ).add( query2 );
bs.getLabel( ).setVisible( true );
//
// bs.setRiserOutline( null );
// bs.setSeriesIdentifier( "Highlight" ); //$NON-NLS-1$
// bs.setLabelPosition( Position.INSIDE_LITERAL );
//
// bs.getTriggers( )
// .add( TriggerImpl.create( TriggerCondition.ONCLICK_LITERAL,
// ActionImpl.create( ActionType.HIGHLIGHT_LITERAL,
// SeriesValueImpl.create( String.valueOf(
bs.getSeriesIdentifier( ) ) ) ) ) );
SeriesDefinition sdY = SeriesDefinitionImpl.create( );
yAxisPrimary.getSeriesDefinitions( ).add( sdY );
sdY.getSeries( ).add( bs );
return cwaBar;
}
/*
* (non-Javadoc)
*
* @see
org.eclipse.swt.events.PaintListener#paintControl(org.eclips e.swt.events.PaintEvent)
*/
public void paintControl( PaintEvent e )
{
try {
idr.setProperty( IDeviceRenderer.GRAPHICS_CONTEXT, e.gc );
Composite co = (Composite) e.getSource( );
Rectangle re = co.getClientArea( );
Bounds bo = BoundsImpl.create( 0, 0, re.width, re.height );
bo.scale( 72d / idr.getDisplayServer( ).getDpiResolution( ) );
RunTimeContext context = new RunTimeContext( );
context.setULocale( ULocale.getDefault( ) );
DateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
String[] set = {
"Items", "Amounts"};//$NON-NLS-1$ //$NON-NLS-2$
Object[][] data = {
{
sdf.parse("2008-02-05"), sdf.parse("2008-05-04"),
sdf.parse("2008-06-05")//$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}, {
new Integer( 7 ), new Integer( 2 ), new Integer( 5 )
}
};
dree = new SimpleDataRowExpressionEvaluator( set, data );
Generator gr = Generator.instance( );
try
{
gr.bindData( dree, cm, context );
gr.render( idr, gr.build( idr.getDisplayServer( ),
cm,
bo,
null,
context,
null ) );
}
catch ( ChartException ce )
{
ce.printStackTrace( );
}
} catch (ParseException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
}
}
In the case of legend shows that the value is the value of X-axis, now I
want the value of legend since I changed the definition of value, such as
the 2008-02-05 into item1 ,2008-05-04 into item2, 2008 -- 06-05 into item3,
I should be how to amend the code. Thanks
"Jason Weathersby" <jasonweathersby@alltel.net>
??????:g6nv8s$9j8$3@build.eclipse.org...
> You may want to look at the color by setting. This is located on the
> third tab of the chart wizard. Select the Series and you will see the
> setting underneath the chart.
>
> Jason
>
> bo.ye wrote:
>> hi all
>> The number in the legend by default shows the X-axis value. If I have
>> to customize the legend of the report egine JAVA code should be used, how
>> to achieve
>> thank you!
>
|
|
|
Re: How to modify the value of legend [message #364401 is a reply to message #364395] |
Wed, 30 July 2008 09:19   |
Eclipse User |
|
|
|
Originally posted by: jasonweathersby.alltel.net
What do you want to change the legend to?
I see you have the dates in there now. What do you want it to be?
Jason
bo.ye wrote:
> hi
> Jason
> I use the report designer can achieve the functions I have to, but I do not
> know how to use JAVA code to achieve. Example:
> /*********************************************************** ************
> * Copyright (c) 2004 Actuate Corporation.
> * All rights reserved. This program and the accompanying materials
> * are made available under the terms of the Eclipse Public License v1.0
> * which accompanies this distribution, and is available at
> * http://www.eclipse.org/legal/epl-v10.html
> *
> * Contributors:
> * Actuate Corporation - initial API and implementation
> ************************************************************ ***********/
>
> package org.eclipse.birt.chart.examples.api.data.autobinding;
>
> import java.text.DateFormat;
> import java.text.ParseException;
> import java.text.SimpleDateFormat;
>
> import org.eclipse.birt.chart.device.IDeviceRenderer;
> import org.eclipse.birt.chart.exception.ChartException;
> import org.eclipse.birt.chart.factory.Generator;
> import org.eclipse.birt.chart.factory.IDataRowExpressionEvaluator;
> import org.eclipse.birt.chart.factory.RunTimeContext;
> import org.eclipse.birt.chart.integrate.SimpleDataRowExpressionEval uator;
> import org.eclipse.birt.chart.model.Chart;
> import org.eclipse.birt.chart.model.ChartWithAxes;
> import org.eclipse.birt.chart.model.attribute.AxisType;
> import org.eclipse.birt.chart.model.attribute.Bounds;
> import org.eclipse.birt.chart.model.attribute.IntersectionType;
> import org.eclipse.birt.chart.model.attribute.LegendBehaviorType;
> import org.eclipse.birt.chart.model.attribute.LegendItemType;
> import org.eclipse.birt.chart.model.attribute.Orientation;
> import org.eclipse.birt.chart.model.attribute.Position;
> import org.eclipse.birt.chart.model.attribute.ScaleUnitType;
> import org.eclipse.birt.chart.model.attribute.TickStyle;
> import org.eclipse.birt.chart.model.attribute.impl.BoundsImpl;
> import org.eclipse.birt.chart.model.attribute.impl.ColorDefinitionI mpl;
> import
> org.eclipse.birt.chart.model.attribute.impl.JavaDateFormatSp ecifierImpl;
> import org.eclipse.birt.chart.model.component.Axis;
> import org.eclipse.birt.chart.model.component.Series;
> import org.eclipse.birt.chart.model.component.impl.SeriesImpl;
> import org.eclipse.birt.chart.model.data.Query;
> import org.eclipse.birt.chart.model.data.SeriesDefinition;
> import org.eclipse.birt.chart.model.data.impl.QueryImpl;
> import org.eclipse.birt.chart.model.data.impl.SeriesDefinitionImpl;
> import org.eclipse.birt.chart.model.impl.ChartWithAxesImpl;
> import org.eclipse.birt.chart.model.layout.Legend;
> import org.eclipse.birt.chart.model.layout.Plot;
> import org.eclipse.birt.chart.model.type.BarSeries;
> import org.eclipse.birt.chart.model.type.impl.BarSeriesImpl;
> import org.eclipse.birt.chart.util.PluginSettings;
> import org.eclipse.swt.SWT;
> import org.eclipse.swt.events.PaintEvent;
> import org.eclipse.swt.events.PaintListener;
> import org.eclipse.swt.graphics.Rectangle;
> import org.eclipse.swt.layout.GridData;
> import org.eclipse.swt.layout.GridLayout;
> import org.eclipse.swt.widgets.Canvas;
> import org.eclipse.swt.widgets.Composite;
> import org.eclipse.swt.widgets.Display;
> import org.eclipse.swt.widgets.Shell;
>
> import com.ibm.icu.util.ULocale;
>
> /**
> * The selector of charts in SWT.
> *
> */
> public final class AutoDataBindingViewer implements
> PaintListener
> {
> private IDeviceRenderer idr = null;
>
> private Chart cm = null;
>
> private IDataRowExpressionEvaluator dree = null;
>
> /**
> * main() method for constructing the layout.
> *
> * @param args
> */
> public static void main( String[] args )
> {
> Display display = Display.getDefault( );
> Shell shell = new Shell( display );
> shell.setSize( 600, 400 );
> shell.setLayout( new GridLayout( ) );
>
> Canvas cCenter = new Canvas( shell, SWT.NONE );
> AutoDataBindingViewer adbv = new AutoDataBindingViewer( );
> cCenter.setLayoutData( new GridData( GridData.FILL_BOTH ) );
> cCenter.addPaintListener( adbv );
>
> shell.open( );
> while ( !shell.isDisposed( ) )
> {
> if ( !display.readAndDispatch( ) )
> display.sleep( );
> }
> display.dispose( );
> }
>
> /**
> * Get the connection with SWT device to render the graphics.
> */
> AutoDataBindingViewer( )
> {
> final PluginSettings ps = PluginSettings.instance( );
> try
> {
> idr = ps.getDevice( "dv.SWT" );//$NON-NLS-1$
> }
> catch ( ChartException ex )
> {
> ex.printStackTrace( );
> }
> cm = createSimpleChart( );
> }
>
> private static final Chart createSimpleChart( )
> {
> ChartWithAxes cwaBar = ChartWithAxesImpl.create( );
> cwaBar.getInteractivity( )
> .setLegendBehavior( LegendBehaviorType.HIGHLIGHT_SERIE_LITERAL );
> // Plot
> cwaBar.getBlock( ).setBackground( ColorDefinitionImpl.WHITE( ) );
> cwaBar.getBlock( ).getOutline( ).setVisible( true );
> Plot p = cwaBar.getPlot( );
> p.getClientArea( ).setBackground( ColorDefinitionImpl.create( 255,
> 255,
> 225 ) );
> // Legend
> Legend lg = cwaBar.getLegend( );
> // cwaBar.getLegend( ).setVisible( false );
> lg.setItemType( LegendItemType.CATEGORIES_LITERAL );
> lg.setPosition( Position.ABOVE_LITERAL );
> lg.setOrientation(Orientation.HORIZONTAL_LITERAL);
> // X-Axis
> Axis xAxisPrimary = cwaBar.getPrimaryBaseAxes( )[0];
> xAxisPrimary.setType( AxisType.TEXT_LITERAL );
> xAxisPrimary.getOrigin( ).setType( IntersectionType.VALUE_LITERAL );
> xAxisPrimary.getTitle( ).setVisible( false );
> xAxisPrimary.setFormatSpecifier( JavaDateFormatSpecifierImpl.create(
> "MM/dd/yyyy" ) );//$NON-NLS-1$
> xAxisPrimary.setType( AxisType.DATE_TIME_LITERAL );
> xAxisPrimary.getScale().setUnit(ScaleUnitType.WEEKS_LITERAL) ;
> xAxisPrimary.getScale().setStepNumber(1);
> xAxisPrimary.getLabel( )
> .getCaption( )
> .setColor( ColorDefinitionImpl.RED( ) );
> xAxisPrimary.getLabel( ).getCaption( ).getFont( ).setRotation( -30 );
> xAxisPrimary.getLabel().setVisible(true);
> // Y-Axis
> Axis yAxisPrimary = cwaBar.getPrimaryOrthogonalAxis( xAxisPrimary );
> yAxisPrimary.getMajorGrid( ).setTickStyle( TickStyle.LEFT_LITERAL );
> yAxisPrimary.setType( AxisType.LINEAR_LITERAL );
> yAxisPrimary.getTitle( ).setVisible( false );
>
> // X-Series
> Series seCategory = SeriesImpl.create( );
> Query query = QueryImpl.create( "Items" );//$NON-NLS-1$
> seCategory.getDataDefinition( ).add( query );
>
> SeriesDefinition sdX = SeriesDefinitionImpl.create( );
> sdX.getSeriesPalette( ).shift( 0 ); // SET THE COLOR IN THE PALETTE
> xAxisPrimary.getSeriesDefinitions( ).add( sdX );
> sdX.getSeries( ).add( seCategory );
> // Y-Series
> BarSeries bs = (BarSeries) BarSeriesImpl.create( );
> Query query2 = QueryImpl.create( "Amounts" );//$NON-NLS-1$
> bs.getDataDefinition( ).add( query2 );
> bs.getLabel( ).setVisible( true );
>
> //
> // bs.setRiserOutline( null );
> // bs.setSeriesIdentifier( "Highlight" ); //$NON-NLS-1$
> // bs.setLabelPosition( Position.INSIDE_LITERAL );
> //
> // bs.getTriggers( )
> // .add( TriggerImpl.create( TriggerCondition.ONCLICK_LITERAL,
> // ActionImpl.create( ActionType.HIGHLIGHT_LITERAL,
> // SeriesValueImpl.create( String.valueOf(
> bs.getSeriesIdentifier( ) ) ) ) ) );
>
>
> SeriesDefinition sdY = SeriesDefinitionImpl.create( );
> yAxisPrimary.getSeriesDefinitions( ).add( sdY );
> sdY.getSeries( ).add( bs );
>
> return cwaBar;
> }
> /*
> * (non-Javadoc)
> *
> * @see
> org.eclipse.swt.events.PaintListener#paintControl(org.eclips e.swt.events.PaintEvent)
> */
> public void paintControl( PaintEvent e )
> {
> try {
> idr.setProperty( IDeviceRenderer.GRAPHICS_CONTEXT, e.gc );
> Composite co = (Composite) e.getSource( );
> Rectangle re = co.getClientArea( );
> Bounds bo = BoundsImpl.create( 0, 0, re.width, re.height );
> bo.scale( 72d / idr.getDisplayServer( ).getDpiResolution( ) );
>
> RunTimeContext context = new RunTimeContext( );
> context.setULocale( ULocale.getDefault( ) );
> DateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
> String[] set = {
> "Items", "Amounts"};//$NON-NLS-1$ //$NON-NLS-2$
>
> Object[][] data = {
> {
> sdf.parse("2008-02-05"), sdf.parse("2008-05-04"),
> sdf.parse("2008-06-05")//$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
> }, {
> new Integer( 7 ), new Integer( 2 ), new Integer( 5 )
> }
>
> };
> dree = new SimpleDataRowExpressionEvaluator( set, data );
> Generator gr = Generator.instance( );
> try
> {
> gr.bindData( dree, cm, context );
> gr.render( idr, gr.build( idr.getDisplayServer( ),
> cm,
> bo,
> null,
> context,
> null ) );
> }
> catch ( ChartException ce )
> {
> ce.printStackTrace( );
> }
> } catch (ParseException e1) {
> // TODO Auto-generated catch block
> e1.printStackTrace();
> }
> }
>
> }
> In the case of legend shows that the value is the value of X-axis, now I
> want the value of legend since I changed the definition of value, such as
> the 2008-02-05 into item1 ,2008-05-04 into item2, 2008 -- 06-05 into item3,
> I should be how to amend the code. Thanks
>
> "Jason Weathersby" <jasonweathersby@alltel.net>
> ??????:g6nv8s$9j8$3@build.eclipse.org...
>> You may want to look at the color by setting. This is located on the
>> third tab of the chart wizard. Select the Series and you will see the
>> setting underneath the chart.
>>
>> Jason
>>
>> bo.ye wrote:
>>> hi all
>>> The number in the legend by default shows the X-axis value. If I have
>>> to customize the legend of the report egine JAVA code should be used, how
>>> to achieve
>>> thank you!
>
>
|
|
|
Re: How to modify the value of legend [message #364527 is a reply to message #364401] |
Wed, 06 August 2008 04:18   |
Eclipse User |
|
|
|
Originally posted by: bo.ye.golferpass.com
I want to edit legend shows the value, such as: "2008-02-05"Change to
"AAA2008-02-05", "2008-05-04" changed to "BBB2008-05-04", "2008-06-05
"Changed to" CCC2008-06-05 ".
"Jason Weathersby" <jasonweathersby@alltel.net>
??????:g6ppet$ssi$1@build.eclipse.org...
> What do you want to change the legend to?
> I see you have the dates in there now. What do you want it to be?
>
> Jason
>
> bo.ye wrote:
>> hi
>> Jason
>> I use the report designer can achieve the functions I have to, but I do
>> not know how to use JAVA code to achieve. Example:
>> /*********************************************************** ************
>> * Copyright (c) 2004 Actuate Corporation.
>> * All rights reserved. This program and the accompanying materials
>> * are made available under the terms of the Eclipse Public License v1.0
>> * which accompanies this distribution, and is available at
>> * http://www.eclipse.org/legal/epl-v10.html
>> *
>> * Contributors:
>> * Actuate Corporation - initial API and implementation
>> ************************************************************ ***********/
>>
>> package org.eclipse.birt.chart.examples.api.data.autobinding;
>>
>> import java.text.DateFormat;
>> import java.text.ParseException;
>> import java.text.SimpleDateFormat;
>>
>> import org.eclipse.birt.chart.device.IDeviceRenderer;
>> import org.eclipse.birt.chart.exception.ChartException;
>> import org.eclipse.birt.chart.factory.Generator;
>> import org.eclipse.birt.chart.factory.IDataRowExpressionEvaluator;
>> import org.eclipse.birt.chart.factory.RunTimeContext;
>> import org.eclipse.birt.chart.integrate.SimpleDataRowExpressionEval uator;
>> import org.eclipse.birt.chart.model.Chart;
>> import org.eclipse.birt.chart.model.ChartWithAxes;
>> import org.eclipse.birt.chart.model.attribute.AxisType;
>> import org.eclipse.birt.chart.model.attribute.Bounds;
>> import org.eclipse.birt.chart.model.attribute.IntersectionType;
>> import org.eclipse.birt.chart.model.attribute.LegendBehaviorType;
>> import org.eclipse.birt.chart.model.attribute.LegendItemType;
>> import org.eclipse.birt.chart.model.attribute.Orientation;
>> import org.eclipse.birt.chart.model.attribute.Position;
>> import org.eclipse.birt.chart.model.attribute.ScaleUnitType;
>> import org.eclipse.birt.chart.model.attribute.TickStyle;
>> import org.eclipse.birt.chart.model.attribute.impl.BoundsImpl;
>> import org.eclipse.birt.chart.model.attribute.impl.ColorDefinitionI mpl;
>> import
>> org.eclipse.birt.chart.model.attribute.impl.JavaDateFormatSp ecifierImpl;
>> import org.eclipse.birt.chart.model.component.Axis;
>> import org.eclipse.birt.chart.model.component.Series;
>> import org.eclipse.birt.chart.model.component.impl.SeriesImpl;
>> import org.eclipse.birt.chart.model.data.Query;
>> import org.eclipse.birt.chart.model.data.SeriesDefinition;
>> import org.eclipse.birt.chart.model.data.impl.QueryImpl;
>> import org.eclipse.birt.chart.model.data.impl.SeriesDefinitionImpl;
>> import org.eclipse.birt.chart.model.impl.ChartWithAxesImpl;
>> import org.eclipse.birt.chart.model.layout.Legend;
>> import org.eclipse.birt.chart.model.layout.Plot;
>> import org.eclipse.birt.chart.model.type.BarSeries;
>> import org.eclipse.birt.chart.model.type.impl.BarSeriesImpl;
>> import org.eclipse.birt.chart.util.PluginSettings;
>> import org.eclipse.swt.SWT;
>> import org.eclipse.swt.events.PaintEvent;
>> import org.eclipse.swt.events.PaintListener;
>> import org.eclipse.swt.graphics.Rectangle;
>> import org.eclipse.swt.layout.GridData;
>> import org.eclipse.swt.layout.GridLayout;
>> import org.eclipse.swt.widgets.Canvas;
>> import org.eclipse.swt.widgets.Composite;
>> import org.eclipse.swt.widgets.Display;
>> import org.eclipse.swt.widgets.Shell;
>>
>> import com.ibm.icu.util.ULocale;
>>
>> /**
>> * The selector of charts in SWT.
>> *
>> */
>> public final class AutoDataBindingViewer implements
>> PaintListener
>> {
>> private IDeviceRenderer idr = null;
>>
>> private Chart cm = null;
>>
>> private IDataRowExpressionEvaluator dree = null;
>>
>> /**
>> * main() method for constructing the layout.
>> *
>> * @param args
>> */
>> public static void main( String[] args )
>> {
>> Display display = Display.getDefault( );
>> Shell shell = new Shell( display );
>> shell.setSize( 600, 400 );
>> shell.setLayout( new GridLayout( ) );
>>
>> Canvas cCenter = new Canvas( shell, SWT.NONE );
>> AutoDataBindingViewer adbv = new AutoDataBindingViewer( );
>> cCenter.setLayoutData( new GridData( GridData.FILL_BOTH ) );
>> cCenter.addPaintListener( adbv );
>>
>> shell.open( );
>> while ( !shell.isDisposed( ) )
>> {
>> if ( !display.readAndDispatch( ) )
>> display.sleep( );
>> }
>> display.dispose( );
>> }
>>
>> /**
>> * Get the connection with SWT device to render the graphics.
>> */
>> AutoDataBindingViewer( )
>> {
>> final PluginSettings ps = PluginSettings.instance( );
>> try
>> {
>> idr = ps.getDevice( "dv.SWT" );//$NON-NLS-1$
>> }
>> catch ( ChartException ex )
>> {
>> ex.printStackTrace( );
>> }
>> cm = createSimpleChart( );
>> }
>>
>> private static final Chart createSimpleChart( )
>> {
>> ChartWithAxes cwaBar = ChartWithAxesImpl.create( );
>> cwaBar.getInteractivity( )
>> .setLegendBehavior( LegendBehaviorType.HIGHLIGHT_SERIE_LITERAL );
>> // Plot
>> cwaBar.getBlock( ).setBackground( ColorDefinitionImpl.WHITE( ) );
>> cwaBar.getBlock( ).getOutline( ).setVisible( true );
>> Plot p = cwaBar.getPlot( );
>> p.getClientArea( ).setBackground( ColorDefinitionImpl.create( 255,
>> 255,
>> 225 ) );
>> // Legend
>> Legend lg = cwaBar.getLegend( );
>> // cwaBar.getLegend( ).setVisible( false );
>> lg.setItemType( LegendItemType.CATEGORIES_LITERAL );
>> lg.setPosition( Position.ABOVE_LITERAL );
>> lg.setOrientation(Orientation.HORIZONTAL_LITERAL);
>> // X-Axis
>> Axis xAxisPrimary = cwaBar.getPrimaryBaseAxes( )[0];
>> xAxisPrimary.setType( AxisType.TEXT_LITERAL );
>> xAxisPrimary.getOrigin( ).setType( IntersectionType.VALUE_LITERAL );
>> xAxisPrimary.getTitle( ).setVisible( false );
>> xAxisPrimary.setFormatSpecifier( JavaDateFormatSpecifierImpl.create(
>> "MM/dd/yyyy" ) );//$NON-NLS-1$
>> xAxisPrimary.setType( AxisType.DATE_TIME_LITERAL );
>> xAxisPrimary.getScale().setUnit(ScaleUnitType.WEEKS_LITERAL) ;
>> xAxisPrimary.getScale().setStepNumber(1);
>> xAxisPrimary.getLabel( )
>> .getCaption( )
>> .setColor( ColorDefinitionImpl.RED( ) );
>> xAxisPrimary.getLabel( ).getCaption( ).getFont( ).setRotation( -30 );
>> xAxisPrimary.getLabel().setVisible(true);
>> // Y-Axis
>> Axis yAxisPrimary = cwaBar.getPrimaryOrthogonalAxis( xAxisPrimary );
>> yAxisPrimary.getMajorGrid( ).setTickStyle( TickStyle.LEFT_LITERAL );
>> yAxisPrimary.setType( AxisType.LINEAR_LITERAL );
>> yAxisPrimary.getTitle( ).setVisible( false );
>>
>> // X-Series
>> Series seCategory = SeriesImpl.create( );
>> Query query = QueryImpl.create( "Items" );//$NON-NLS-1$
>> seCategory.getDataDefinition( ).add( query );
>>
>> SeriesDefinition sdX = SeriesDefinitionImpl.create( );
>> sdX.getSeriesPalette( ).shift( 0 ); // SET THE COLOR IN THE PALETTE
>> xAxisPrimary.getSeriesDefinitions( ).add( sdX );
>> sdX.getSeries( ).add( seCategory );
>> // Y-Series
>> BarSeries bs = (BarSeries) BarSeriesImpl.create( );
>> Query query2 = QueryImpl.create( "Amounts" );//$NON-NLS-1$
>> bs.getDataDefinition( ).add( query2 );
>> bs.getLabel( ).setVisible( true );
>>
>> //
>> // bs.setRiserOutline( null );
>> // bs.setSeriesIdentifier( "Highlight" ); //$NON-NLS-1$
>> // bs.setLabelPosition( Position.INSIDE_LITERAL );
>> //
>> // bs.getTriggers( )
>> // .add( TriggerImpl.create( TriggerCondition.ONCLICK_LITERAL,
>> // ActionImpl.create( ActionType.HIGHLIGHT_LITERAL,
>> // SeriesValueImpl.create( String.valueOf(
>> bs.getSeriesIdentifier( ) ) ) ) ) );
>>
>>
>> SeriesDefinition sdY = SeriesDefinitionImpl.create( );
>> yAxisPrimary.getSeriesDefinitions( ).add( sdY );
>> sdY.getSeries( ).add( bs );
>>
>> return cwaBar;
>> }
>> /*
>> * (non-Javadoc)
>> *
>> * @see
>> org.eclipse.swt.events.PaintListener#paintControl(org.eclips e.swt.events.PaintEvent)
>> */
>> public void paintControl( PaintEvent e )
>> {
>> try {
>> idr.setProperty( IDeviceRenderer.GRAPHICS_CONTEXT, e.gc );
>> Composite co = (Composite) e.getSource( );
>> Rectangle re = co.getClientArea( );
>> Bounds bo = BoundsImpl.create( 0, 0, re.width, re.height );
>> bo.scale( 72d / idr.getDisplayServer( ).getDpiResolution( ) );
>>
>> RunTimeContext context = new RunTimeContext( );
>> context.setULocale( ULocale.getDefault( ) );
>> DateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
>> String[] set = {
>> "Items", "Amounts"};//$NON-NLS-1$ //$NON-NLS-2$
>>
>> Object[][] data = {
>> {
>> sdf.parse("2008-02-05"), sdf.parse("2008-05-04"),
>> sdf.parse("2008-06-05")//$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
>> }, {
>> new Integer( 7 ), new Integer( 2 ), new Integer( 5 )
>> }
>>
>> };
>> dree = new SimpleDataRowExpressionEvaluator( set, data );
>> Generator gr = Generator.instance( );
>> try
>> {
>> gr.bindData( dree, cm, context );
>> gr.render( idr, gr.build( idr.getDisplayServer( ),
>> cm,
>> bo,
>> null,
>> context,
>> null ) );
>> }
>> catch ( ChartException ce )
>> {
>> ce.printStackTrace( );
>> }
>> } catch (ParseException e1) {
>> // TODO Auto-generated catch block
>> e1.printStackTrace();
>> }
>> }
>>
>> }
>> In the case of legend shows that the value is the value of X-axis, now I
>> want the value of legend since I changed the definition of value, such as
>> the 2008-02-05 into item1 ,2008-05-04 into item2, 2008 -- 06-05 into
>> item3, I should be how to amend the code. Thanks
>>
>> "Jason Weathersby" <jasonweathersby@alltel.net>
>> ??????:g6nv8s$9j8$3@build.eclipse.org...
>>> You may want to look at the color by setting. This is located on the
>>> third tab of the chart wizard. Select the Series and you will see the
>>> setting underneath the chart.
>>>
>>> Jason
>>>
>>> bo.ye wrote:
>>>> hi all
>>>> The number in the legend by default shows the X-axis value. If I
>>>> have to customize the legend of the report egine JAVA code should be
>>>> used, how to achieve
>>>> thank you!
>>
>>
>
|
|
|
Re: How to modify the value of legend [message #364567 is a reply to message #364527] |
Fri, 08 August 2008 10:31   |
Eclipse User |
|
|
|
Originally posted by: jasonweathersby.alltel.net
You may be able to do this using the beforeDrawLegendItem event script
for the chart. Look at the attached example report that uses script to
modify the legend.
Jason
<?xml version="1.0" encoding="UTF-8"?>
<report xmlns="http://www.eclipse.org/birt/2005/design" version="3.2.15"
id="1">
<property name="createdBy">Eclipse BIRT Designer Version
2.2.1.r221_v20070924 Build <2.2.0.v20070924-1550></property>
<property name="units">in</property>
<property name="comments">Copyright (c) 2007</property>
<html-property name="description">Creates a blank report with no
predefined content.</html-property>
<text-property name="displayName">Blank Report</text-property>
<property name="iconFile">/templates/blank_report.gif</property>
<data-sources>
<script-data-source name="Data Source" id="5"/>
</data-sources>
<data-sets>
<script-data-set name="Data Set" id="6">
<list-property name="resultSetHints">
<structure>
<property name="position">1</property>
<property name="name">category</property>
<property name="dataType">string</property>
</structure>
<structure>
<property name="position">2</property>
<property name="name">series2</property>
<property name="dataType">float</property>
</structure>
<structure>
<property name="position">3</property>
<property name="name">series1</property>
<property name="dataType">float</property>
</structure>
<structure>
<property name="position">4</property>
<property name="name">series3</property>
<property name="dataType">float</property>
</structure>
</list-property>
<list-property name="columnHints">
<structure>
<property name="columnName">category</property>
</structure>
<structure>
<property name="columnName">series2</property>
</structure>
<structure>
<property name="columnName">series1</property>
</structure>
<structure>
<property name="columnName">series3</property>
</structure>
</list-property>
<structure name="cachedMetaData">
<list-property name="resultSet">
<structure>
<property name="position">1</property>
<property name="name">category</property>
<property name="dataType">string</property>
</structure>
<structure>
<property name="position">2</property>
<property name="name">series2</property>
<property name="dataType">float</property>
</structure>
<structure>
<property name="position">3</property>
<property name="name">series1</property>
<property name="dataType">float</property>
</structure>
<structure>
<property name="position">4</property>
<property name="name">series3</property>
<property name="dataType">float</property>
</structure>
</list-property>
</structure>
<property name="dataSource">Data Source</property>
<method name="open"><![CDATA[i = 0;
sourcedata = new Array( new Array(4),
new Array(4),
new Array(4),
new Array(4),
new Array(4));
sourcedata[0][0] = "Item1";
sourcedata[0][1] = 25;
sourcedata[0][2] = 10;
sourcedata[0][3] = 15;
sourcedata[1][0] = "Item2";
sourcedata[1][1] = 35;
sourcedata[1][2] = null;
sourcedata[1][3] = 10;
sourcedata[2][0] = "Item3";
sourcedata[2][1] = 15;
sourcedata[2][2] = 25;
sourcedata[2][3] = 10;]]></method>
<method name="fetch"><![CDATA[if ( i < 3 )
{
row["category"] = sourcedata[i][0];
row["series1"] = sourcedata[i][1];
row["series2"]= sourcedata[i][2];
row["series3"]= sourcedata[i][3];
i++;
return true;
}
return false;]]></method>
</script-data-set>
</data-sets>
<page-setup>
<simple-master-page name="Simple MasterPage" id="2"/>
</page-setup>
<body>
<extended-item extensionName="Chart" name="Stacked Line Chart"
id="7">
<xml-property
name="xmlRepresentation"><![CDATA[<model:ChartWithAxes
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:attribute="http://www.birt.eclipse.org/ChartModelAttribute"
xmlns:data="http://www.birt.eclipse.org/ChartModelData"
xmlns:layout="http://www.birt.eclipse.org/ChartModelLayout"
xmlns:model="http://www.birt.eclipse.org/ChartModel"
xmlns:type="http://www.birt.eclipse.org/ChartModelType">
<Type>Line Chart</Type>
<SubType>Stacked</SubType>
<Block>
<Children xsi:type="layout:TitleBlock">
<Bounds>
<Left>0.0</Left>
<Top>0.0</Top>
<Width>0.0</Width>
<Height>0.0</Height>
</Bounds>
<Insets>
<Top>3.0</Top>
<Left>3.0</Left>
<Bottom>3.0</Bottom>
<Right>3.0</Right>
</Insets>
<Row>-1</Row>
<Column>-1</Column>
<Rowspan>-1</Rowspan>
<Columnspan>-1</Columnspan>
<Outline>
<Style>Solid</Style>
<Thickness>1</Thickness>
<Color>
<Transparency>255</Transparency>
<Red>0</Red>
<Green>0</Green>
<Blue>0</Blue>
</Color>
<Visible>false</Visible>
</Outline>
<Visible>true</Visible>
<Label>
<Caption>
<Value>Stacked Line Chart</Value>
<Font>
<Size>16.0</Size>
<Bold>true</Bold>
<Alignment>
<horizontalAlignment>Center</horizontalAlignment>
<verticalAlignment>Center</verticalAlignment>
</Alignment>
</Font>
</Caption>
<Background xsi:type="attribute:ColorDefinition">
<Transparency>0</Transparency>
<Red>255</Red>
<Green>255</Green>
<Blue>255</Blue>
</Background>
<Outline>
<Style>Solid</Style>
<Thickness>1</Thickness>
<Color>
<Transparency>255</Transparency>
<Red>0</Red>
<Green>0</Green>
<Blue>0</Blue>
</Color>
</Outline>
<Insets>
<Top>0.0</Top>
<Left>2.0</Left>
<Bottom>0.0</Bottom>
<Right>3.0</Right>
</Insets>
<Visible>true</Visible>
</Label>
</Children>
<Children xsi:type="layout:Plot">
<Bounds>
<Left>0.0</Left>
<Top>0.0</Top>
<Width>0.0</Width>
<Height>0.0</Height>
</Bounds>
<Insets>
<Top>3.0</Top>
<Left>3.0</Left>
<Bottom>3.0</Bottom>
<Right>3.0</Right>
</Insets>
<Row>-1</Row>
<Column>-1</Column>
<Rowspan>-1</Rowspan>
<Columnspan>-1</Columnspan>
<Outline>
<Style>Solid</Style>
<Thickness>1</Thickness>
<Color>
<Transparency>255</Transparency>
<Red>0</Red>
<Green>0</Green>
<Blue>0</Blue>
</Color>
<Visible>false</Visible>
</Outline>
<Visible>true</Visible>
<HorizontalSpacing>5</HorizontalSpacing>
<VerticalSpacing>5</VerticalSpacing>
<ClientArea>
<Background xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>255</Red>
<Green>255</Green>
<Blue>225</Blue>
</Background>
<Outline>
<Style>Solid</Style>
<Thickness>0</Thickness>
<Color>
<Transparency>255</Transparency>
<Red>0</Red>
<Green>0</Green>
<Blue>0</Blue>
</Color>
<Visible>false</Visible>
</Outline>
<Insets>
<Top>0.0</Top>
<Left>0.0</Left>
<Bottom>0.0</Bottom>
<Right>0.0</Right>
</Insets>
</ClientArea>
</Children>
<Children xsi:type="layout:Legend">
<Bounds>
<Left>0.0</Left>
<Top>0.0</Top>
<Width>0.0</Width>
<Height>0.0</Height>
</Bounds>
<Insets>
<Top>3.0</Top>
<Left>3.0</Left>
<Bottom>3.0</Bottom>
<Right>3.0</Right>
</Insets>
<Row>-1</Row>
<Column>-1</Column>
<Rowspan>-1</Rowspan>
<Columnspan>-1</Columnspan>
<Outline>
<Style>Solid</Style>
<Thickness>1</Thickness>
<Color>
<Transparency>255</Transparency>
<Red>0</Red>
<Green>0</Green>
<Blue>0</Blue>
</Color>
<Visible>false</Visible>
</Outline>
<Visible>true</Visible>
<ClientArea>
<Outline>
<Style>Solid</Style>
<Thickness>0</Thickness>
<Color>
<Transparency>255</Transparency>
<Red>0</Red>
<Green>0</Green>
<Blue>0</Blue>
</Color>
<Visible>false</Visible>
</Outline>
<Insets>
<Top>2.0</Top>
<Left>2.0</Left>
<Bottom>2.0</Bottom>
<Right>2.0</Right>
</Insets>
</ClientArea>
<Text>
<Value></Value>
<Font>
<Alignment/>
</Font>
</Text>
<Orientation>Vertical</Orientation>
<Direction>Top_Bottom</Direction>
<Separator>
<Style>Solid</Style>
<Thickness>1</Thickness>
<Color>
<Transparency>255</Transparency>
<Red>0</Red>
<Green>0</Green>
<Blue>0</Blue>
</Color>
<Visible>true</Visible>
</Separator>
<Position>Right</Position>
<ItemType>Series</ItemType>
<Title>
<Caption>
<Value></Value>
<Font>
<Alignment/>
</Font>
</Caption>
<Background xsi:type="attribute:ColorDefinition">
<Transparency>0</Transparency>
<Red>255</Red>
<Green>255</Green>
<Blue>255</Blue>
</Background>
<Outline>
<Style>Solid</Style>
<Thickness>1</Thickness>
<Color>
<Transparency>255</Transparency>
<Red>0</Red>
<Green>0</Green>
<Blue>0</Blue>
</Color>
<Visible>false</Visible>
</Outline>
<Insets>
<Top>0.0</Top>
<Left>2.0</Left>
<Bottom>0.0</Bottom>
<Right>3.0</Right>
</Insets>
<Visible>false</Visible>
</Title>
<TitlePosition>Above</TitlePosition>
</Children>
<Bounds>
<Left>0.0</Left>
<Top>0.0</Top>
<Width>432.0</Width>
<Height>216.0</Height>
</Bounds>
<Insets>
<Top>3.0</Top>
<Left>3.0</Left>
<Bottom>3.0</Bottom>
<Right>3.0</Right>
</Insets>
<Row>-1</Row>
<Column>-1</Column>
<Rowspan>-1</Rowspan>
<Columnspan>-1</Columnspan>
<Outline>
<Style>Solid</Style>
<Thickness>1</Thickness>
<Color>
<Transparency>255</Transparency>
<Red>0</Red>
<Green>0</Green>
<Blue>0</Blue>
</Color>
<Visible>false</Visible>
</Outline>
<Background xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>255</Red>
<Green>255</Green>
<Blue>255</Blue>
</Background>
<Visible>true</Visible>
</Block>
<Dimension>Two_Dimensional</Dimension>
<Script>function beforeDrawLegendItem(lerh, bounds, icsc)
{
if(
lerh.getLabel().getCaption().getValue().compareToIgnoreCase( "series3")
== 0 ){
bounds.setHeight(0);
bounds.setWidth(0);
lerh.getLabel().setVisible(false);
}else{
lerh.getLabel().setVisible(true);
}
importPackage( Packages.org.eclipse.birt.chart.model.attribute.impl );
label = lerh.getLabel();
labelString = label.getCaption().getValue();
if( labelString == "series2" ){
label.getCaption( ).getColor( ).set( 32, 168, 255 );
label.getCaption().getFont().setItalic(true);
label.getCaption().getFont().setRotation(5);
label.getCaption().getFont().setStrikethrough(true);
label.getCaption().getFont().setSize(12);
label.getCaption().getFont().setName("Arial&quo t;);
label.getOutline().setVisible(true);
label.getOutline().setThickness(3);
var mycolor = ColorDefinitionImpl.BLUE();
r = mycolor.getRed();
g = mycolor.getGreen();
b = mycolor.getBlue();
lerh.getFill().set(r, g, b);
}
}
/**
* Called before rendering each label on a given Axis.
*
* @param axis
* Axis
* @param label
* Label
* @param icsc
* IChartScriptContext
*/
function beforeDrawAxisLabel(axis, label, icsc)
{
if( label.getCaption().getValue() == "0" ){
label.getCaption().setValue("");
}
}</Script>
<Units>Points</Units>
<SeriesThickness>10.0</SeriesThickness>
<GridColumnCount>1</GridColumnCount>
<SampleData>
<BaseSampleData>
<DataSetRepresentation>'A','B','C'</DataSetRepresentation>
</BaseSampleData>
<OrthogonalSampleData>
<DataSetRepresentation>5.0,4.0,12.0</DataSetRepresentation >
<SeriesDefinitionIndex>0</SeriesDefinitionIndex>
</OrthogonalSampleData>
<OrthogonalSampleData>
<DataSetRepresentation>10.0,8.0,24.0</DataSetRepresentation >
<SeriesDefinitionIndex>1</SeriesDefinitionIndex>
</OrthogonalSampleData>
<OrthogonalSampleData>
<DataSetRepresentation>15.0,12.0,36.0</DataSetRepresentation >
<SeriesDefinitionIndex>2</SeriesDefinitionIndex>
</OrthogonalSampleData>
</SampleData>
<Interactivity>
<Enable>true</Enable>
<LegendBehavior>None</LegendBehavior>
</Interactivity>
<Axes>
<Type>Text</Type>
<Title>
<Caption>
<Value>X-Axis Title</Value>
<Font>
<Size>14.0</Size>
<Bold>true</Bold>
<Alignment>
<horizontalAlignment>Center</horizontalAlignment>
<verticalAlignment>Center</verticalAlignment>
</Alignment>
</Font>
</Caption>
<Background xsi:type="attribute:ColorDefinition">
<Transparency>0</Transparency>
<Red>255</Red>
<Green>255</Green>
<Blue>255</Blue>
</Background>
<Outline>
<Style>Solid</Style>
<Thickness>1</Thickness>
<Color>
<Transparency>255</Transparency>
<Red>0</Red>
<Green>0</Green>
<Blue>0</Blue>
</Color>
</Outline>
<Insets>
<Top>0.0</Top>
<Left>2.0</Left>
<Bottom>0.0</Bottom>
<Right>3.0</Right>
</Insets>
<Visible>false</Visible>
</Title>
<TitlePosition>Below</TitlePosition>
<AssociatedAxes>
<Type>Linear</Type>
<Title>
<Caption>
<Value>Y-Axis Title</Value>
<Font>
<Size>14.0</Size>
<Bold>true</Bold>
<Alignment>
<horizontalAlignment>Center</horizontalAlignment>
<verticalAlignment>Center</verticalAlignment>
</Alignment>
<Rotation>90.0</Rotation>
</Font>
</Caption>
<Background xsi:type="attribute:ColorDefinition">
<Transparency>0</Transparency>
<Red>255</Red>
<Green>255</Green>
<Blue>255</Blue>
</Background>
<Outline>
<Style>Solid</Style>
<Thickness>1</Thickness>
<Color>
<Transparency>255</Transparency>
<Red>0</Red>
<Green>0</Green>
<Blue>0</Blue>
</Color>
</Outline>
<Insets>
<Top>0.0</Top>
<Left>2.0</Left>
<Bottom>0.0</Bottom>
<Right>3.0</Right>
</Insets>
<Visible>false</Visible>
</Title>
<TitlePosition>Left</TitlePosition>
<SeriesDefinitions>
<Query>
<Definition></Definition>
</Query>
<SeriesPalette>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>80</Red>
<Green>166</Green>
<Blue>218</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>242</Red>
<Green>88</Green>
<Blue>106</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>232</Red>
<Green>172</Green>
<Blue>57</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>128</Red>
<Green>255</Green>
<Blue>128</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>64</Red>
<Green>128</Green>
<Blue>128</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>128</Red>
<Green>128</Green>
<Blue>192</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>170</Red>
<Green>85</Green>
<Blue>85</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>128</Red>
<Green>128</Green>
<Blue>0</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>192</Red>
<Green>192</Green>
<Blue>192</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>255</Red>
<Green>255</Green>
<Blue>128</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>128</Red>
<Green>192</Green>
<Blue>128</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>7</Red>
<Green>146</Green>
<Blue>94</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>0</Red>
<Green>128</Green>
<Blue>255</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>255</Red>
<Green>128</Green>
<Blue>192</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>0</Red>
<Green>255</Green>
<Blue>255</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>255</Red>
<Green>128</Green>
<Blue>128</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>0</Red>
<Green>128</Green>
<Blue>192</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>128</Red>
<Green>128</Green>
<Blue>192</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>255</Red>
<Green>0</Green>
<Blue>255</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>128</Red>
<Green>64</Green>
<Blue>64</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>255</Red>
<Green>128</Green>
<Blue>64</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>80</Red>
<Green>240</Green>
<Blue>120</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>0</Red>
<Green>64</Green>
<Blue>128</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>128</Red>
<Green>0</Green>
<Blue>64</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>255</Red>
<Green>0</Green>
<Blue>128</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>128</Red>
<Green>128</Green>
<Blue>64</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>128</Red>
<Green>128</Green>
<Blue>128</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>255</Red>
<Green>128</Green>
<Blue>255</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>0</Red>
<Green>64</Green>
<Blue>0</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>0</Red>
<Green>0</Green>
<Blue>0</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>255</Red>
<Green>255</Green>
<Blue>255</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>255</Red>
<Green>128</Green>
<Blue>0</Blue>
</Entries>
</SeriesPalette>
<Series xsi:type="type:LineSeries">
<Visible>true</Visible>
<Label>
<Caption>
<Value></Value>
<Font>
<Alignment/>
</Font>
</Caption>
<Background xsi:type="attribute:ColorDefinition">
<Transparency>0</Transparency>
<Red>255</Red>
<Green>255</Green>
<Blue>255</Blue>
</Background>
<Outline>
<Style>Solid</Style>
<Thickness>1</Thickness>
<Color>
<Transparency>255</Transparency>
<Red>0</Red>
<Green>0</Green>
<Blue>0</Blue>
</Color>
<Visible>false</Visible>
</Outline>
<Insets>
<Top>0.0</Top>
<Left>2.0</Left>
<Bottom>0.0</Bottom>
<Right>3.0</Right>
</Insets>
<Visible>true</Visible>
</Label>
<DataDefinition>
<Definition>row["series2"]</Definition>
</DataDefinition>
<SeriesIdentifier>series1</SeriesIdentifier>
<DataPoint>
<Components>
<Type>Orthogonal_Value</Type>
</Components>
<Separator>, </Separator>
</DataPoint>
<LabelPosition>Above</LabelPosition>
<Stacked>true</Stacked>
<Translucent>false</Translucent>
<Markers>
<Type>Triangle</Type>
<Size>4</Size>
<Visible>true</Visible>
</Markers>
<LineAttributes>
<Style>Solid</Style>
<Thickness>1</Thickness>
<Color>
<Transparency>255</Transparency>
<Red>249</Red>
<Green>225</Green>
<Blue>191</Blue>
</Color>
<Visible>true</Visible>
</LineAttributes>
<PaletteLineColor>false</PaletteLineColor>
<Curve>false</Curve>
<ShadowColor>
<Transparency>0</Transparency>
<Red>255</Red>
<Green>255</Green>
<Blue>255</Blue>
</ShadowColor>
<ConnectMissingValue>true</ConnectMissingValue>
</Series>
<Grouping>
<Enabled>false</Enabled>
<GroupingInterval>2</GroupingInterval>
<GroupType>Text</GroupType>
<AggregateExpression>Sum</AggregateExpression>
</Grouping>
<Sorting>Descending</Sorting>
</SeriesDefinitions>
<SeriesDefinitions>
<Query>
<Definition></Definition>
</Query>
<SeriesPalette>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>242</Red>
<Green>88</Green>
<Blue>106</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>232</Red>
<Green>172</Green>
<Blue>57</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>128</Red>
<Green>255</Green>
<Blue>128</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>64</Red>
<Green>128</Green>
<Blue>128</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>128</Red>
<Green>128</Green>
<Blue>192</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>170</Red>
<Green>85</Green>
<Blue>85</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>128</Red>
<Green>128</Green>
<Blue>0</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>192</Red>
<Green>192</Green>
<Blue>192</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>255</Red>
<Green>255</Green>
<Blue>128</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>128</Red>
<Green>192</Green>
<Blue>128</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>7</Red>
<Green>146</Green>
<Blue>94</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>0</Red>
<Green>128</Green>
<Blue>255</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>255</Red>
<Green>128</Green>
<Blue>192</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>0</Red>
<Green>255</Green>
<Blue>255</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>255</Red>
<Green>128</Green>
<Blue>128</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>0</Red>
<Green>128</Green>
<Blue>192</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>128</Red>
<Green>128</Green>
<Blue>192</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>255</Red>
<Green>0</Green>
<Blue>255</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>128</Red>
<Green>64</Green>
<Blue>64</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>255</Red>
<Green>128</Green>
<Blue>64</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>80</Red>
<Green>240</Green>
<Blue>120</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>0</Red>
<Green>64</Green>
<Blue>128</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>128</Red>
<Green>0</Green>
<Blue>64</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>255</Red>
<Green>0</Green>
<Blue>128</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>128</Red>
<Green>128</Green>
<Blue>64</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>128</Red>
<Green>128</Green>
<Blue>128</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>255</Red>
<Green>128</Green>
<Blue>255</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>0</Red>
<Green>64</Green>
<Blue>0</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>0</Red>
<Green>0</Green>
<Blue>0</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>255</Red>
<Green>255</Green>
<Blue>255</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>255</Red>
<Green>128</Green>
<Blue>0</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>80</Red>
<Green>166</Green>
<Blue>218</Blue>
</Entries>
</SeriesPalette>
<Series xsi:type="type:LineSeries">
<Visible>true</Visible>
<Label>
<Caption>
<Value></Value>
<Font>
<Alignment/>
</Font>
</Caption>
<Background xsi:type="attribute:ColorDefinition">
<Transparency>0</Transparency>
<Red>255</Red>
<Green>255</Green>
<Blue>255</Blue>
</Background>
<Outline>
<Style>Solid</Style>
<Thickness>1</Thickness>
<Color>
<Transparency>255</Transparency>
<Red>0</Red>
<Green>0</Green>
<Blue>0</Blue>
</Color>
<Visible>false</Visible>
</Outline>
<Insets>
<Top>0.0</Top>
<Left>2.0</Left>
<Bottom>0.0</Bottom>
<Right>3.0</Right>
</Insets>
<Visible>true</Visible>
</Label>
<DataDefinition>
<Definition>row["series1"]</Definition>
</DataDefinition>
<SeriesIdentifier>series2</SeriesIdentifier>
<DataPoint>
<Components>
<Type>Orthogonal_Value</Type>
</Components>
<Separator>, </Separator>
</DataPoint>
<LabelPosition>Above</LabelPosition>
<Stacked>true</Stacked>
<Markers>
<Type>Triangle</Type>
<Size>4</Size>
<Visible>true</Visible>
</Markers>
<LineAttributes>
<Style>Solid</Style>
<Thickness>1</Thickness>
<Color>
<Transparency>255</Transparency>
<Red>249</Red>
<Green>225</Green>
<Blue>191</Blue>
</Color>
<Visible>true</Visible>
</LineAttributes>
<PaletteLineColor>false</PaletteLineColor>
</Series>
<Grouping>
<Enabled>false</Enabled>
<GroupingInterval>2</GroupingInterval>
<GroupType>Text</GroupType>
<AggregateExpression>Sum</AggregateExpression>
</Grouping>
<Sorting>Descending</Sorting>
</SeriesDefinitions>
<SeriesDefinitions>
<Query>
<Definition></Definition>
</Query>
<SeriesPalette>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>232</Red>
<Green>172</Green>
<Blue>57</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>128</Red>
<Green>255</Green>
<Blue>128</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>64</Red>
<Green>128</Green>
<Blue>128</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>128</Red>
<Green>128</Green>
<Blue>192</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>170</Red>
<Green>85</Green>
<Blue>85</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>128</Red>
<Green>128</Green>
<Blue>0</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>192</Red>
<Green>192</Green>
<Blue>192</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>255</Red>
<Green>255</Green>
<Blue>128</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>128</Red>
<Green>192</Green>
<Blue>128</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>7</Red>
<Green>146</Green>
<Blue>94</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>0</Red>
<Green>128</Green>
<Blue>255</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>255</Red>
<Green>128</Green>
<Blue>192</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>0</Red>
<Green>255</Green>
<Blue>255</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>255</Red>
<Green>128</Green>
<Blue>128</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>0</Red>
<Green>128</Green>
<Blue>192</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>128</Red>
<Green>128</Green>
<Blue>192</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>255</Red>
<Green>0</Green>
<Blue>255</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>128</Red>
<Green>64</Green>
<Blue>64</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>255</Red>
<Green>128</Green>
<Blue>64</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>80</Red>
<Green>240</Green>
<Blue>120</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>0</Red>
<Green>64</Green>
<Blue>128</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>128</Red>
<Green>0</Green>
<Blue>64</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>255</Red>
<Green>0</Green>
<Blue>128</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>128</Red>
<Green>128</Green>
<Blue>64</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>128</Red>
<Green>128</Green>
<Blue>128</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>255</Red>
<Green>128</Green>
<Blue>255</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>0</Red>
<Green>64</Green>
<Blue>0</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>0</Red>
<Green>0</Green>
<Blue>0</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>255</Red>
<Green>255</Green>
<Blue>255</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>255</Red>
<Green>128</Green>
<Blue>0</Blue>
</Entries>
|
|
|
Re: How to modify the value of legend [message #364743 is a reply to message #364567] |
Wed, 20 August 2008 05:10   |
Eclipse User |
|
|
|
Originally posted by: bo.ye.golferpass.com
thank you.
This code can be set on the legend:
package org.eclipse.birt.chart.examples.api.script.java;
import org.eclipse.birt.chart.model.component.Label;
import org.eclipse.birt.chart.script.ChartEventHandlerAdapter;
import org.eclipse.birt.chart.script.IChartScriptContext;
public class LegendScript extends ChartEventHandlerAdapter
(
/ *
* (Non-Javadoc)
*
* @ See org.eclipse.birt.chart.script.IChartItemScriptHandler #
beforeDrawLegendEntry (org.eclipse.birt.chart.model.component.Label,
* Org.eclipse.birt.chart.script.IChartScriptContext)
* /
public void beforeDrawLegendEntry (Label label, IChartScriptContext icsc)
(
label.getCaption (). getColor (). set (35, 184, 245);
Label.getCaption (). GetFont (). SetBold (true);
label.getCaption (). getFont (). setItalic (true);
Label.getOutline (). SetVisible (true);
label.getOutline (). getColor (). set (177, 12, 187);
)
)
This code can only modify the style of legend, how were dynamic from legend
in the value of its revision
"Jason Weathersby" <jasonweathersby@alltel.net>
??????:g7hl1s$4c2$1@build.eclipse.org...
> You may be able to do this using the beforeDrawLegendItem event script for
> the chart. Look at the attached example report that uses script to modify
> the legend.
>
>
> Jason
>
>
> <?xml version="1.0" encoding="UTF-8"?>
> <report xmlns="http://www.eclipse.org/birt/2005/design" version="3.2.15"
> id="1">
> <property name="createdBy">Eclipse BIRT Designer Version
> 2.2.1.r221_v20070924 Build <2.2.0.v20070924-1550></property>
> <property name="units">in</property>
> <property name="comments">Copyright (c) 2007</property>
> <html-property name="description">Creates a blank report with no
> predefined content.</html-property>
> <text-property name="displayName">Blank Report</text-property>
> <property name="iconFile">/templates/blank_report.gif</property>
> <data-sources>
> <script-data-source name="Data Source" id="5"/>
> </data-sources>
> <data-sets>
> <script-data-set name="Data Set" id="6">
> <list-property name="resultSetHints">
> <structure>
> <property name="position">1</property>
> <property name="name">category</property>
> <property name="dataType">string</property>
> </structure>
> <structure>
> <property name="position">2</property>
> <property name="name">series2</property>
> <property name="dataType">float</property>
> </structure>
> <structure>
> <property name="position">3</property>
> <property name="name">series1</property>
> <property name="dataType">float</property>
> </structure>
> <structure>
> <property name="position">4</property>
> <property name="name">series3</property>
> <property name="dataType">float</property>
> </structure>
> </list-property>
> <list-property name="columnHints">
> <structure>
> <property name="columnName">category</property>
> </structure>
> <structure>
> <property name="columnName">series2</property>
> </structure>
> <structure>
> <property name="columnName">series1</property>
> </structure>
> <structure>
> <property name="columnName">series3</property>
> </structure>
> </list-property>
> <structure name="cachedMetaData">
> <list-property name="resultSet">
> <structure>
> <property name="position">1</property>
> <property name="name">category</property>
> <property name="dataType">string</property>
> </structure>
> <structure>
> <property name="position">2</property>
> <property name="name">series2</property>
> <property name="dataType">float</property>
> </structure>
> <structure>
> <property name="position">3</property>
> <property name="name">series1</property>
> <property name="dataType">float</property>
> </structure>
> <structure>
> <property name="position">4</property>
> <property name="name">series3</property>
> <property name="dataType">float</property>
> </structure>
> </list-property>
> </structure>
> <property name="dataSource">Data Source</property>
> <method name="open"><![CDATA[i = 0;
>
> sourcedata = new Array( new Array(4),
> new Array(4),
> new Array(4),
> new Array(4),
> new Array(4));
> sourcedata[0][0] = "Item1";
> sourcedata[0][1] = 25;
> sourcedata[0][2] = 10;
> sourcedata[0][3] = 15;
>
> sourcedata[1][0] = "Item2";
> sourcedata[1][1] = 35;
> sourcedata[1][2] = null;
> sourcedata[1][3] = 10;
>
> sourcedata[2][0] = "Item3";
> sourcedata[2][1] = 15;
> sourcedata[2][2] = 25;
> sourcedata[2][3] = 10;]]></method>
> <method name="fetch"><![CDATA[if ( i < 3 )
> {
> row["category"] = sourcedata[i][0];
> row["series1"] = sourcedata[i][1];
> row["series2"]= sourcedata[i][2];
> row["series3"]= sourcedata[i][3];
> i++;
> return true;
> }
> return false;]]></method>
> </script-data-set>
> </data-sets>
> <page-setup>
> <simple-master-page name="Simple MasterPage" id="2"/>
> </page-setup>
> <body>
> <extended-item extensionName="Chart" name="Stacked Line Chart"
> id="7">
> <xml-property
> name="xmlRepresentation"><![CDATA[<model:ChartWithAxes
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:attribute="http://www.birt.eclipse.org/ChartModelAttribute"
> xmlns:data="http://www.birt.eclipse.org/ChartModelData"
> xmlns:layout="http://www.birt.eclipse.org/ChartModelLayout"
> xmlns:model="http://www.birt.eclipse.org/ChartModel"
> xmlns:type="http://www.birt.eclipse.org/ChartModelType">
> <Type>Line Chart</Type>
> <SubType>Stacked</SubType>
> <Block>
> <Children xsi:type="layout:TitleBlock">
> <Bounds>
> <Left>0.0</Left>
> <Top>0.0</Top>
> <Width>0.0</Width>
> <Height>0.0</Height>
> </Bounds>
> <Insets>
> <Top>3.0</Top>
> <Left>3.0</Left>
> <Bottom>3.0</Bottom>
> <Right>3.0</Right>
> </Insets>
> <Row>-1</Row>
> <Column>-1</Column>
> <Rowspan>-1</Rowspan>
> <Columnspan>-1</Columnspan>
> <Outline>
> <Style>Solid</Style>
> <Thickness>1</Thickness>
> <Color>
> <Transparency>255</Transparency>
> <Red>0</Red>
> <Green>0</Green>
> <Blue>0</Blue>
> </Color>
> <Visible>false</Visible>
> </Outline>
> <Visible>true</Visible>
> <Label>
> <Caption>
> <Value>Stacked Line Chart</Value>
> <Font>
> <Size>16.0</Size>
> <Bold>true</Bold>
> <Alignment>
> <horizontalAlignment>Center</horizontalAlignment>
> <verticalAlignment>Center</verticalAlignment>
> </Alignment>
> </Font>
> </Caption>
> <Background xsi:type="attribute:ColorDefinition">
> <Transparency>0</Transparency>
> <Red>255</Red>
> <Green>255</Green>
> <Blue>255</Blue>
> </Background>
> <Outline>
> <Style>Solid</Style>
> <Thickness>1</Thickness>
> <Color>
> <Transparency>255</Transparency>
> <Red>0</Red>
> <Green>0</Green>
> <Blue>0</Blue>
> </Color>
> </Outline>
> <Insets>
> <Top>0.0</Top>
> <Left>2.0</Left>
> <Bottom>0.0</Bottom>
> <Right>3.0</Right>
> </Insets>
> <Visible>true</Visible>
> </Label>
> </Children>
> <Children xsi:type="layout:Plot">
> <Bounds>
> <Left>0.0</Left>
> <Top>0.0</Top>
> <Width>0.0</Width>
> <Height>0.0</Height>
> </Bounds>
> <Insets>
> <Top>3.0</Top>
> <Left>3.0</Left>
> <Bottom>3.0</Bottom>
> <Right>3.0</Right>
> </Insets>
> <Row>-1</Row>
> <Column>-1</Column>
> <Rowspan>-1</Rowspan>
> <Columnspan>-1</Columnspan>
> <Outline>
> <Style>Solid</Style>
> <Thickness>1</Thickness>
> <Color>
> <Transparency>255</Transparency>
> <Red>0</Red>
> <Green>0</Green>
> <Blue>0</Blue>
> </Color>
> <Visible>false</Visible>
> </Outline>
> <Visible>true</Visible>
> <HorizontalSpacing>5</HorizontalSpacing>
> <VerticalSpacing>5</VerticalSpacing>
> <ClientArea>
> <Background xsi:type="attribute:ColorDefinition">
> <Transparency>255</Transparency>
> <Red>255</Red>
> <Green>255</Green>
> <Blue>225</Blue>
> </Background>
> <Outline>
> <Style>Solid</Style>
> <Thickness>0</Thickness>
> <Color>
> <Transparency>255</Transparency>
> <Red>0</Red>
> <Green>0</Green>
> <Blue>0</Blue>
> </Color>
> <Visible>false</Visible>
> </Outline>
> <Insets>
> <Top>0.0</Top>
> <Left>0.0</Left>
> <Bottom>0.0</Bottom>
> <Right>0.0</Right>
> </Insets>
> </ClientArea>
> </Children>
> <Children xsi:type="layout:Legend">
> <Bounds>
> <Left>0.0</Left>
> <Top>0.0</Top>
> <Width>0.0</Width>
> <Height>0.0</Height>
> </Bounds>
> <Insets>
> <Top>3.0</Top>
> <Left>3.0</Left>
> <Bottom>3.0</Bottom>
> <Right>3.0</Right>
> </Insets>
> <Row>-1</Row>
> <Column>-1</Column>
> <Rowspan>-1</Rowspan>
> <Columnspan>-1</Columnspan>
> <Outline>
> <Style>Solid</Style>
> <Thickness>1</Thickness>
> <Color>
> <Transparency>255</Transparency>
> <Red>0</Red>
> <Green>0</Green>
> <Blue>0</Blue>
> </Color>
> <Visible>false</Visible>
> </Outline>
> <Visible>true</Visible>
> <ClientArea>
> <Outline>
> <Style>Solid</Style>
> <Thickness>0</Thickness>
> <Color>
> <Transparency>255</Transparency>
> <Red>0</Red>
> <Green>0</Green>
> <Blue>0</Blue>
> </Color>
> <Visible>false</Visible>
> </Outline>
> <Insets>
> <Top>2.0</Top>
> <Left>2.0</Left>
> <Bottom>2.0</Bottom>
> <Right>2.0</Right>
> </Insets>
> </ClientArea>
> <Text>
> <Value></Value>
> <Font>
> <Alignment/>
> </Font>
> </Text>
> <Orientation>Vertical</Orientation>
> <Direction>Top_Bottom</Direction>
> <Separator>
> <Style>Solid</Style>
> <Thickness>1</Thickness>
> <Color>
> <Transparency>255</Transparency>
> <Red>0</Red>
> <Green>0</Green>
> <Blue>0</Blue>
> </Color>
> <Visible>true</Visible>
> </Separator>
> <Position>Right</Position>
> <ItemType>Series</ItemType>
> <Title>
> <Caption>
> <Value></Value>
> <Font>
> <Alignment/>
> </Font>
> </Caption>
> <Background xsi:type="attribute:ColorDefinition">
> <Transparency>0</Transparency>
> <Red>255</Red>
> <Green>255</Green>
> <Blue>255</Blue>
> </Background>
> <Outline>
> <Style>Solid</Style>
> <Thickness>1</Thickness>
> <Color>
> <Transparency>255</Transparency>
> <Red>0</Red>
> <Green>0</Green>
> <Blue>0</Blue>
> </Color>
> <Visible>false</Visible>
> </Outline>
> <Insets>
> <Top>0.0</Top>
> <Left>2.0</Left>
> <Bottom>0.0</Bottom>
> <Right>3.0</Right>
> </Insets>
> <Visible>false</Visible>
> </Title>
> <TitlePosition>Above</TitlePosition>
> </Children>
> <Bounds>
> <Left>0.0</Left>
> <Top>0.0</Top>
> <Width>432.0</Width>
> <Height>216.0</Height>
> </Bounds>
> <Insets>
> <Top>3.0</Top>
> <Left>3.0</Left>
> <Bottom>3.0</Bottom>
> <Right>3.0</Right>
> </Insets>
> <Row>-1</Row>
> <Column>-1</Column>
> <Rowspan>-1</Rowspan>
> <Columnspan>-1</Columnspan>
> <Outline>
> <Style>Solid</Style>
> <Thickness>1</Thickness>
> <Color>
> <Transparency>255</Transparency>
> <Red>0</Red>
> <Green>0</Green>
> <Blue>0</Blue>
> </Color>
> <Visible>false</Visible>
> </Outline>
> <Background xsi:type="attribute:ColorDefinition">
> <Transparency>255</Transparency>
> <Red>255</Red>
> <Green>255</Green>
> <Blue>255</Blue>
> </Background>
> <Visible>true</Visible>
> </Block>
> <Dimension>Two_Dimensional</Dimension>
> <Script>function beforeDrawLegendItem(lerh, bounds, icsc)
> {
> if(
> lerh.getLabel().getCaption().getValue().compareToIgnoreCase( "series3")
> == 0 ){
>
> bounds.setHeight(0);
> bounds.setWidth(0);
> lerh.getLabel().setVisible(false);
>
> }else{
> lerh.getLabel().setVisible(true);
> }
> importPackage( Packages.org.eclipse.birt.chart.model.attribute.impl );
>
> label = lerh.getLabel();
> labelString = label.getCaption().getValue();
> if( labelString == "series2" ){
> label.getCaption( ).getColor( ).set( 32, 168, 255 );
> label.getCaption().getFont().setItalic(true);
> label.getCaption().getFont().setRotation(5);
> label.getCaption().getFont().setStrikethrough(true);
> label.getCaption().getFont().setSize(12);
> label.getCaption().getFont().setName("Arial&quo t;);
> label.getOutline().setVisible(true);
> label.getOutline().setThickness(3);
>
> var mycolor = ColorDefinitionImpl.BLUE();
> r = mycolor.getRed();
> g = mycolor.getGreen();
> b = mycolor.getBlue();
> lerh.getFill().set(r, g, b);
> }
>
> }
> /**
> * Called before rendering each label on a given Axis.
> *
> * @param axis
> * Axis
> * @param label
> * Label
> * @param icsc
> * IChartScriptContext
> */
>
> function beforeDrawAxisLabel(axis, label, icsc)
> {
> if( label.getCaption().getValue() == "0" ){
> label.getCaption().setValue("");
> }
> }</Script>
> <Units>Points</Units>
> <SeriesThickness>10.0</SeriesThickness>
> <GridColumnCount>1</GridColumnCount>
> <SampleData>
> <BaseSampleData>
> <DataSetRepresentation>'A','B','C'</DataSetRepresentation>
> </BaseSampleData>
> <OrthogonalSampleData>
> <DataSetRepresentation>5.0,4.0,12.0</DataSetRepresentation >
> <SeriesDefinitionIndex>0</SeriesDefinitionIndex>
> </OrthogonalSampleData>
> <OrthogonalSampleData>
> <DataSetRepresentation>10.0,8.0,24.0</DataSetRepresentation >
> <SeriesDefinitionIndex>1</SeriesDefinitionIndex>
> </OrthogonalSampleData>
> <OrthogonalSampleData>
> <DataSetRepresentation>15.0,12.0,36.0</DataSetRepresentation >
> <SeriesDefinitionIndex>2</SeriesDefinitionIndex>
> </OrthogonalSampleData>
> </SampleData>
> <Interactivity>
> <Enable>true</Enable>
> <LegendBehavior>None</LegendBehavior>
> </Interactivity>
> <Axes>
> <Type>Text</Type>
> <Title>
> <Caption>
> <Value>X-Axis Title</Value>
> <Font>
> <Size>14.0</Size>
> <Bold>true</Bold>
> <Alignment>
> <horizontalAlignment>Center</horizontalAlignment>
> <verticalAlignment>Center</verticalAlignment>
> </Alignment>
> </Font>
> </Caption>
> <Background xsi:type="attribute:ColorDefinition">
> <Transparency>0</Transparency>
> <Red>255</Red>
> <Green>255</Green>
> <Blue>255</Blue>
> </Background>
> <Outline>
> <Style>Solid</Style>
> <Thickness>1</Thickness>
> <Color>
> <Transparency>255</Transparency>
> <Red>0</Red>
> <Green>0</Green>
> <Blue>0</Blue>
> </Color>
> </Outline>
> <Insets>
> <Top>0.0</Top>
> <Left>2.0</Left>
> <Bottom>0.0</Bottom>
> <Right>3.0</Right>
> </Insets>
> <Visible>false</Visible>
> </Title>
> <TitlePosition>Below</TitlePosition>
> <AssociatedAxes>
> <Type>Linear</Type>
> <Title>
> <Caption>
> <Value>Y-Axis Title</Value>
> <Font>
> <Size>14.0</Size>
> <Bold>true</Bold>
> <Alignment>
> <horizontalAlignment>Center</horizontalAlignment>
> <verticalAlignment>Center</verticalAlignment>
> </Alignment>
> <Rotation>90.0</Rotation>
> </Font>
> </Caption>
> <Background xsi:type="attribute:ColorDefinition">
> <Transparency>0</Transparency>
> <Red>255</Red>
> <Green>255</Green>
> <Blue>255</Blue>
> </Background>
> <Outline>
> <Style>Solid</Style>
> <Thickness>1</Thickness>
> <Color>
> <Transparency>255</Transparency>
> <Red>0</Red>
> <Green>0</Green>
> <Blue>0</Blue>
> </Color>
> </Outline>
> <Insets>
> <Top>0.0</Top>
> <Left>2.0</Left>
> <Bottom>0.0</Bottom>
> <Right>3.0</Right>
> </Insets>
> <Visible>false</Visible>
> </Title>
> <TitlePosition>Left</TitlePosition>
> <SeriesDefinitions>
> <Query>
> <Definition></Definition>
> </Query>
> <SeriesPalette>
> <Entries xsi:type="attribute:ColorDefinition">
> <Transparency>255</Transparency>
> <Red>80</Red>
> <Green>166</Green>
> <Blue>218</Blue>
> </Entries>
> <Entries xsi:type="attribute:ColorDefinition">
> <Transparency>255</Transparency>
> <Red>242</Red>
> <Green>88</Green>
> <Blue>106</Blue>
> </Entries>
> <Entries xsi:type="attribute:ColorDefinition">
> <Transparency>255</Transparency>
> <Red>232</Red>
> <Green>172</Green>
> <Blue>57</Blue>
> </Entries>
> <Entries xsi:type="attribute:ColorDefinition">
> <Transparency>255</Transparency>
> <Red>128</Red>
> <Green>255</Green>
> <Blue>128</Blue>
> </Entries>
> <Entries xsi:type="attribute:ColorDefinition">
> <Transparency>255</Transparency>
> <Red>64</Red>
> <Green>128</Green>
> <Blue>128</Blue>
> </Entries>
> <Entries xsi:type="attribute:ColorDefinition">
> <Transparency>255</Transparency>
> <Red>128</Red>
> <Green>128</Green>
> <Blue>192</Blue>
> </Entries>
> <Entries xsi:type="attribute:ColorDefinition">
> <Transparency>255</Transparency>
> <Red>170</Red>
> <Green>85</Green>
> <Blue>85</Blue>
> </Entries>
> <Entries xsi:type="attribute:ColorDefinition">
> <Transparency>255</Transparency>
> <Red>128</Red>
> <Green>128</Green>
> <Blue>0</Blue>
> </Entries>
> <Entries xsi:type="attribute:ColorDefinition">
> <Transparency>255</Transparency>
> <Red>192</Red>
> <Green>192</Green>
> <Blue>192</Blue>
> </Entries>
> <Entries xsi:type="attribute:ColorDefinition">
> <Transparency>255</Transparency>
> <Red>255</Red>
> <Green>255</Green>
> <Blue>128</Blue>
> </Entries>
> <Entries xsi:type="attribute:ColorDefinition">
> <Transparency>255</Transparency>
> <Red>128</Red>
> <Green>192</Green>
> <Blue>128</Blue>
> </Entries>
> <Entries xsi:type="attribute:ColorDefinition">
> <Transparency>255</Transparency>
> <Red>7</Red>
> <Green>146</Green>
> <Blue>94</Blue>
> </Entries>
> <Entries xsi:type="attribute:ColorDefinition">
> <Transparency>255</Transparency>
> <Red>0</Red>
> <Green>128</Green>
> <Blue>255</Blue>
> </Entries>
> <Entries xsi:type="attribute:ColorDefinition">
> <Transparency>255</Transparency>
> <Red>255</Red>
> <Green>128</Green>
> <Blue>192</Blue>
> </Entries>
> <Entries xsi:type="attribute:ColorDefinition">
> <Transparency>255</Transparency>
> <Red>0</Red>
> <Green>255</Green>
> <Blue>255</Blue>
> </Entries>
> <Entries xsi:type="attribute:ColorDefinition">
> <Transparency>255</Transparency>
> <Red>255</Red>
> <Green>128</Green>
> <Blue>128</Blue>
> </Entries>
> <Entries xsi:type="attribute:ColorDefinition">
> <Transparency>255</Transparency>
> <Red>0</Red>
> <Green>128</Green>
> <Blue>192</Blue>
> </Entries>
> <Entries xsi:type="attribute:ColorDefinition">
> <Transparency>255</Transparency>
> <Red>128</Red>
> <Green>128</Green>
> <Blue>192</Blue>
> </Entries>
> <Entries xsi:type="attribute:ColorDefinition">
> <Transparency>255</Transparency>
> <Red>255</Red>
> <Green>0</Green>
> <Blue>255</Blue>
> </Entries>
> <Entries xsi:type="attribute:ColorDefinition">
> <Transparency>255</Transparency>
> <Red>128</Red>
> <Green>64</Green>
> <Blue>64</Blue>
> </Entries>
> <Entries xsi:type="attribute:ColorDefinition">
> <Transparency>255</Transparency>
> <Red>255</Red>
> <Green>128</Green>
> <Blue>64</Blue>
> </Entries>
> <Entries xsi:type="attribute:ColorDefinition">
> <Transparency>255</Transparency>
> <Red>80</Red>
> <Green>240</Green>
> <Blue>120</Blue>
> </Entries>
> <Entries xsi:type="attribute:ColorDefinition">
> <Transparency>255</Transparency>
> <Red>0</Red>
> <Green>64</Green>
> <Blue>128</Blue>
> </Entries>
> <Entries xsi:type="attribute:ColorDefinition">
> <Transparency>255</Transparency>
> <Red>128</Red>
> <Green>0</Green>
> <Blue>64</Blue>
> </Entries>
> <Entries xsi:type="attribute:ColorDefinition">
> <Transparency>255</Transparency>
> <Red>255</Red>
> <Green>0</Green>
> <Blue>128</Blue>
> </Entries>
> <Entries xsi:type="attribute:ColorDefinition">
> <Transparency>255</Transparency>
> <Red>128</Red>
> <Green>128</Green>
> <Blue>64</Blue>
> </Entries>
> <Entries xsi:type="attribute:ColorDefinition">
> <Transparency>255</Transparency>
> <Red>128</Red>
> <Green>128</Green>
> <Blue>128</Blue>
> </Entries>
> <Entries xsi:type="attribute:ColorDefinition">
> <Transparency>255</Transparency>
> <Red>255</Red>
> <Green>128</Green>
> <Blue>255</Blue>
> </Entries>
> <Entries xsi:type="attribute:ColorDefinition">
> <Transparency>255</Transparency>
> <Red>0</Red>
> <Green>64</Green>
> <Blue>0</Blue>
> </Entries>
> <Entries xsi:type="attribute:ColorDefinition">
> <Transparency>255</Transparency>
> <Red>0</Red>
> <Green>0</Green>
> <Blue>0</Blue>
> </Entries>
> <Entries xsi:type="attribute:ColorDefinition">
> <Transparency>255</Transparency>
> <Red>255</Red>
> <Green>255</Green>
> <Blue>255</Blue>
> </Entries>
> <Entries xsi:type="attribute:ColorDefinition">
> <Transparency>255</Transparency>
> <Red>255</Red>
> <Green>128</Green>
> <Blue>0</Blue>
> </Entries>
> </SeriesPalette>
> <Series xsi:type="type:LineSeries">
> <Visible>true</Visible>
> <Label>
> <Caption>
> <Value></Value>
> <Font>
> <Alignment/>
> </Font>
> </Caption>
> <Background xsi:type="attribute:ColorDefinition">
> <Transparency>0</Transparency>
> <Red>255</Red>
> <Green>255</Green>
> <Blue>255</Blue>
> </Background>
> <Outline>
> <Style>Solid</Style>
> <Thickness>1</Thickness>
> <Color>
> <Transparency>255</Transparency>
> <Red>0</Red>
> <Green>0</Green>
> <Blue>0</Blue>
> </Color>
> <Visible>false</Visible>
> </Outline>
> <Insets>
> <Top>0.0</Top>
> <Left>2.0</Left>
> <Bottom>0.0</Bottom>
> <Right>3.0</Right>
> </Insets>
> <Visible>true</Visible>
> </Label>
> <DataDefinition>
> <Definition>row["series2"]</Definition>
> </DataDefinition>
> <SeriesIdentifier>series1</SeriesIdentifier>
> <DataPoint>
> <Components>
> <Type>Orthogonal_Value</Type>
> </Components>
> <Separator>, </Separator>
> </DataPoint>
> <LabelPosition>Above</LabelPosition>
> <Stacked>true</Stacked>
> <Translucent>false</Translucent>
> <Markers>
> <Type>Triangle</Type>
> <Size>4</Size>
> <Visible>true</Visible>
> </Markers>
> <LineAttributes>
> <Style>Solid</Style>
> <Thickness>1</Thickness>
> <Color>
> <Transparency>255</Transparency>
> <Red>249</Red>
> <Green>225</Green>
> <Blue>191</Blue>
> </Color>
> <Visible>true</Visible>
> </LineAttributes>
> <PaletteLineColor>false</PaletteLineColor>
> <Curve>false</Curve>
> <ShadowColor>
> <Transparency>0</Transparency>
> <Red>255</Red>
> <Green>255</Green>
> <Blue>255</Blue>
> </ShadowColor>
> <ConnectMissingValue>true</ConnectMissingValue>
> </Series>
> <Grouping>
> <Enabled>false</Enabled>
> <GroupingInterval>2</GroupingInterval>
> <GroupType>Text</GroupType>
> <AggregateExpression>Sum</AggregateExpression>
> </Grouping>
> <Sorting>Descending</Sorting>
> </SeriesDefinitions>
> <SeriesDefinitions>
> <Query>
> <Definition></Definition>
> </Query>
> <SeriesPalette>
> <Entries xsi:type="attribute:ColorDefinition">
> <Transparency>255</Transparency>
> <Red>242</Red>
> <Green>88</Green>
> <Blue>106</Blue>
> </Entries>
> <Entries xsi:type="attribute:ColorDefinition">
> <Transparency>255</Transparency>
> <Red>232</Red>
> <Green>172</Green>
> <Blue>57</Blue>
> </Entries>
> <Entries xsi:type="attribute:ColorDefinition">
> <Transparency>255</Transparency>
> <Red>128</Red>
> <Green>255</Green>
> <Blue>128</Blue>
> </Entries>
> <Entries xsi:type="attribute:ColorDefinition">
> <Transparency>255</Transparency>
> <Red>64</Red>
> <Green>128</Green>
> <Blue>128</Blue>
> </Entries>
> <Entries xsi:type="attribute:ColorDefinition">
> <Transparency>255</Transparency>
> <Red>128</Red>
> <Green>128</Green>
> <Blue>192</Blue>
> </Entries>
> <Entries xsi:type="attribute:ColorDefinition">
> <Transparency>255</Transparency>
> <Red>170</Red>
> <Green>85</Green>
> <Blue>85</Blue>
> </Entries>
> <Entries xsi:type="attribute:ColorDefinition">
> <Transparency>255</Transparency>
> <Red>128</Red>
> <Green>128</Green>
> <Blue>0</Blue>
> </Entries>
> <Entries xsi:type="attribute:ColorDefinition">
> <Transparency>255</Transparency>
> <Red>192</Red>
> <Green>192</Green>
> <Blue>192</Blue>
> </Entries>
> <Entries xsi:type="attribute:ColorDefinition">
> <Transparency>255</Transparency>
> <Red>255</Red>
> <Green>255</Green>
> <Blue>128</Blue>
> </Entries>
> <Entries xsi:type="attribute:ColorDefinition">
> <Transparency>255</Transparency>
> <Red>128</Red>
> <Green>192</Green>
> <Blue>128</Blue>
> </Entries>
> <Entries xsi:type="attribute:ColorDefinition">
> <Transparency>255</Transparency>
> <Red>7</Red>
> <Green>146</Green>
> <Blue>94</Blue>
> </Entries>
> <Entries xsi:type="attribute:ColorDefinition">
> <Transparency>255</Transparency>
> <Red>0</Red>
> <Green>128</Green>
> <Blue>255</Blue>
> </Entries>
> <Entries xsi:type="attribute:ColorDefinition">
> <Transparency>255</Transparency>
> <Red>255</Red>
> <Green>128</Green>
> <Blue>192</Blue>
> </Entries>
> <Entries xsi:type="attribute:ColorDefinition">
> <Transparency>255</Transparency>
> <Red>0</Red>
> <Green>255</Green>
> <Blue>255</Blue>
> </Entries>
> <Entries xsi:type="attribute:ColorDefinition">
> <Transparency>255</Transparency>
> <Red>255</Red>
> <Green>128</Green>
> <Blue>128</Blue>
> </Entries>
> <Entries xsi:type="attribute:ColorDefinition">
> <Transparency>255</Transparency>
> <Red>0</Red>
> <Green>128</Green>
> <Blue>192</Blue>
> </Entries>
> <Entries xsi:type="attribute:ColorDefinition">
> <Transparency>255</Transparency>
> <Red>128</Red>
> <Green>128</Green>
> <Blue>192</Blue>
> </Entries>
> <Entries xsi:type="attribute:ColorDefinition">
> <Transparency>255</Transparency>
> <Red>255</Red>
> <Green>0</Green>
> <Blue>255</Blue>
> </Entries>
> <Entries xsi:type="attribute:ColorDefinition">
> <Transparency>255</Transparency>
> <Red>128</Red>
> <Green>64</Green>
> <Blue>64</Blue>
> </Entries>
> <Entries xsi:type="attribute:ColorDefinition">
> <Transparency>255</Transparency>
> <Red>255</Red>
> <Green>128</Green>
> <Blue>64</Blue>
> </Entries>
> <Entries xsi:type="attribute:ColorDefinition">
> <Transparency>255</Transparency>
> <Red>80</Red>
> <Green>240</Green>
> <Blue>120</Blue>
> </Entries>
> <Entries xsi:type="attribute:ColorDefinition">
> <Transparency>255</Transparency>
> <Red>0</Red>
> <Green>64</Green>
> <Blue>128</Blue>
> </Entries>
> <Entries xsi:type="attribute:ColorDefinition">
> <Transparency>255</Transparency>
> <Red>128</Red>
> <Green>0</Green>
> <Blue>64</Blue>
> </Entries>
> <Entries xsi:type="attribute:ColorDefinition">
> <Transparency>255</Transparency>
> <Red>255</Red>
> <Green>0</Green>
> <Blue>128</Blue>
> </Entries>
> <Entries xsi:type="attribute:ColorDefinition">
> <Transparency>255</Transparency>
> <Red>128</Red>
> <Green>128</Green>
> <Blue>64</Blue>
> </Entries>
> <Entries xsi:type="attribute:ColorDefinition">
> <Transparency>255</Transparency>
> <Red>128</Red>
> <Green>128</Green>
> <Blue>128</Blue>
> </Entries>
> <Entries xsi:type="attribute:ColorDefinition">
> <Transparency>255</Transparency>
> <Red>255</Red>
> <Green>128</Green>
> <Blue>255</Blue>
> </Entries>
> <Entries xsi:type="attribute:ColorDefinition">
> <Transparency>255</Transparency>
> <Red>0</Red>
> <Green>64</Green>
> <Blue>0</Blue>
> </Entries>
> <Entries xsi:type="attribute:ColorDefinition">
> <Transparency>255</Transparency>
> <Red>0</Red>
> <Green>0</Green>
> <Blue>0</Blue>
> </Entries>
> <Entries xsi:type="attribute:ColorDefinition">
> <Transparency>255</Transparency>
> <Red>255</Red>
> <Green>255</Green>
> <Blue>255</Blue>
> </Entries>
> <Entries xsi:type="attribute:ColorDefinition">
> <Transparency>255</Transparency>
> <Red>255</Red>
> <Green>128</Green>
> <Blue>0</Blue>
> </Entries>
> <Entries xsi:type="attribute:ColorDefinition">
> <Transparency>255</Transparency>
> <Red>80</Red>
> <Green>166</Green>
> <Blue>218</Blue>
> </Entries>
> </SeriesPalette>
> <Series xsi:type="type:LineSeries">
> <Visible>true</Visible>
> <Label>
> <Caption>
> <Value></Value>
> <Font>
> <Alignment/>
> </Font>
> </Caption>
> <Background xsi:type="attribute:ColorDefinition">
> <Transparency>0</Transparency>
> <Red>255</Red>
> <Green>255</Green>
> <Blue>255</Blue>
> </Background>
> <Outline>
> <Style>Solid</Style>
> <Thickness>1</Thickness>
> <Color>
> <Transparency>255</Transparency>
> <Red>0</Red>
> <Green>0</Green>
> <Blue>0</Blue>
> </Color>
> <Visible>false</Visible>
> </Outline>
> <Insets>
> <Top>0.0</Top>
> <Left>2.0</Left>
> <Bottom>0.0</Bottom>
> <Right>3.0</Right>
> </Insets>
> <Visible>true</Visible>
> </Label>
> <DataDefinition>
> <Definition>row["series1"]</Definition>
> </DataDefinition>
> <SeriesIdentifier>series2</SeriesIdentifier>
> <DataPoint>
> <Components>
> <Type>Orthogonal_Value</Type>
> </Components>
> <Separator>, </Separator>
> </DataPoint>
> <LabelPosition>Above</LabelPosition>
> <Stacked>true</Stacked>
> <Markers>
> <Type>Triangle</Type>
> <Size>4</Size>
> <Visible>true</Visible>
> </Markers>
> <LineAttributes>
> <Style>Solid</Style>
> <Thickness>1</Thickness>
> <Color>
> <Transparency>255</Transparency>
> <Red>249</Red>
> <Green>225</Green>
> <Blue>191</Blue>
> </Color>
> <Visible>true</Visible>
> </LineAttributes>
> <PaletteLineColor>false</PaletteLineColor>
> </Series>
> <Grouping>
> <Enabled>false</Enabled>
> <GroupingInterval>2</GroupingInterval>
> <GroupType>Text</GroupType>
> <AggregateExpression>Sum</AggregateExpression>
> </Grouping>
> <Sorting>Descending</Sorting>
> </SeriesDefinitions>
> <SeriesDefinitions>
> <Query>
> <Definition></Definition>
> </Query>
> <SeriesPalette>
> <Entries xsi:type="attribute:ColorDefinition">
> <Transparency>255</Transparency>
> <Red>232</Red>
> <Green>172</Green>
> <Blue>57</Blue>
> </Entries>
> <Entries xsi:type="attribute:ColorDefinition">
> <Transparency>255</Transparency>
> <Red>128</Red>
> <Green>255</Green>
> <Blue>128</Blue>
> </Entries>
> <Entries xsi:type="attribute:ColorDefinition">
> <Transparency>255</Transparency>
> <Red>64</Red>
> <Green>128</Green>
> <Blue>128</Blue>
> </Entries>
> <Entries xsi:type="attribute:ColorDefinition">
> <Transparency>255</Transparency>
> <Red>128</Red>
> <Green>128</Green>
> <Blue>192</Blue>
> </Entries>
> <Entries xsi:type="attribute:ColorDefinition">
> <Transparency>255</Transparency>
> <Red>170</Red>
> <Green>85</Green>
> <Blue>85</Blue>
> </Entries>
> <Entries xsi:type="attribute:ColorDefinition">
> <Transparency>255</Transparency>
> <Red>128</Red>
> <Green>128</Green>
> <Blue>0</Blue>
> </Entries>
> <Entries xsi:type="attribute:ColorDefinition">
> <Transparency>255</Transparency>
> <Red>192</Red>
> <Green>192</Green>
> <Blue>192</Blue>
> </Entries>
> <Entries xsi:type="attribute:ColorDefinition">
> <Transparency>255</Transparency>
> <Red>255</Red>
> <Green>255</Green>
> <Blue>128</Blue>
> </Entries>
> <Entries xsi:type="attribute:ColorDefinition">
> <Transparency>255</Transparency>
> <Red>128</Red>
> <Green>192</Green>
> <Blue>128</Blue>
> </Entries>
> <Entries xsi:type="attribute:ColorDefinition">
> <Transparency>255</Transparency>
> <Red>7</Red>
> <Green>146</Green>
> <Blue>94</Blue>
> </Entries>
> <Entries xsi:type="attribute:ColorDefinition">
> <Transparency>255</Transparency>
> <Red>0</Red>
> <Green>128</Green>
> <Blue>255</Blue>
> </Entries>
> <Entries xsi:type="attribu
|
|
|
Re: How to modify the value of legend [message #1787176 is a reply to message #364348] |
Mon, 21 May 2018 06:26  |
Eclipse User |
|
|
|
The Chart title and legend are displayed on the top at the center. Using the position property of title, I can either put it on left, top, right, bottom in actuate BIRT
I would like to display it on top-left corner instead of top-center. Is it possible?
Thanks in Advance!
|
|
|
Goto Forum:
Current Time: Sun Mar 23 05:20:08 EDT 2025
Powered by FUDForum. Page generated in 0.04657 seconds
|