Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » Chart Engine API - how to implement zoom
Chart Engine API - how to implement zoom [message #532094] Fri, 07 May 2010 07:40 Go to next message
Martin Lange is currently offline Martin LangeFriend
Messages: 16
Registered: May 2010
Location: Munich, Germany
Junior Member

Hi,

i'am currently developing an Eclipse RCP application and use the BIRT Chart Engine API to visualize some data.

I need to possibility to zoom in and out my charts. Can someone give me an example how to implement this.

Or to help me, developing an own implementation:
- how can I get the bounds of the client area (chart.getPlot.getClientArea())
- how can I scale my chart. (e.g. x-axis from 15 to 25, instead of 0 to 100)
- is it possible to write an mouse move/ mouse down/ mouse up event handler in Java and get the coords of the cursor.

Thanks in advance!
-- Martin
Re: Chart Engine API - how to implement zoom [message #532273 is a reply to message #532094] Fri, 07 May 2010 18:16 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Martin,

Will the SVG Zoom capability not work for you?

I do not have an example of this in the chart engine api, but you should
be able to implement something using a callback.

There is an example of implementing a callback for swt charts in the
source. Its called SwtInteractivityViewer.java. If you setup callback
on the axis, you should be able to do something with a zoom. The
callback is passed the event which has the coordinates and then you can
just rescale the axis and repaint the chart. I am attaching the
SwtInteractivyViewer.java class and the chart model that sets up a
callback on the series (click on a bar).

Chart model

protected static final Chart createCBChart( )
{
ChartWithAxes cwaBar = ChartWithAxesImpl.create( );
cwaBar.getBlock( ).setBackground( ColorDefinitionImpl.WHITE( ) );
cwaBar.getTitle( )
.getLabel( )
.getCaption( )
.setValue( "Click \"Items\" to Call Back" ); //$NON-NLS-1$
cwaBar.setUnitSpacing( 20 );

Legend lg = cwaBar.getLegend( );
LineAttributes lia = lg.getOutline( );
lg.getText( ).getFont( ).setSize( 16 );
lia.setStyle( LineStyle.SOLID_LITERAL );
lg.getInsets( ).set( 10, 5, 0, 0 );
lg.getOutline( ).setVisible( false );
lg.setAnchor( Anchor.NORTH_LITERAL );
lg.setItemType( LegendItemType.CATEGORIES_LITERAL );

// X-Axis
Axis xAxisPrimary = cwaBar.getPrimaryBaseAxes( )[0];

xAxisPrimary.setType( AxisType.TEXT_LITERAL );
xAxisPrimary.getMajorGrid( ).setTickStyle( TickStyle.BELOW_LITERAL );
xAxisPrimary.getOrigin( ).setType( IntersectionType.VALUE_LITERAL );
xAxisPrimary.getTitle( ).setVisible( true );

// Y-Axis
Axis yAxisPrimary = cwaBar.getPrimaryOrthogonalAxis( xAxisPrimary );
yAxisPrimary.getMajorGrid( ).setTickStyle( TickStyle.LEFT_LITERAL );
yAxisPrimary.setType( AxisType.LINEAR_LITERAL );
yAxisPrimary.getLabel( ).getCaption( ).getFont( ).setRotation( 90 );

// Data Set
TextDataSet categoryValues = TextDataSetImpl.create( new String[]{
"Item 1", "Item 2", "Item 3"} ); //$NON-NLS-1$ //$NON-NLS-2$
//$NON-NLS-3$
NumberDataSet orthoValues = NumberDataSetImpl.create( new double[]{
25, 35, 15
} );

// X-Series
Series seCategory = SeriesImpl.create( );
seCategory.setDataSet( categoryValues );

SeriesDefinition sdX = SeriesDefinitionImpl.create( );
sdX.getSeriesPalette( ).shift( 0 );
xAxisPrimary.getSeriesDefinitions( ).add( sdX );
sdX.getSeries( ).add( seCategory );

// Y-Series
BarSeries bs = (BarSeries) BarSeriesImpl.create( );
bs.setDataSet( orthoValues );
bs.setRiserOutline( null );
bs.setSeriesIdentifier( "Callback" ); //$NON-NLS-1$
bs.getLabel( ).setVisible( true );
bs.setLabelPosition( Position.INSIDE_LITERAL );
bs.getTriggers( )
.add( TriggerImpl.create( TriggerCondition.ONCLICK_LITERAL,
ActionImpl.create( ActionType.CALL_BACK_LITERAL,
CallBackValueImpl.create( String.valueOf(
bs.getSeriesIdentifier( ) ) ) ) ) );

SeriesDefinition sdY = SeriesDefinitionImpl.create( );
yAxisPrimary.getSeriesDefinitions( ).add( sdY );
sdY.getSeries( ).add( bs );

return cwaBar;
}

Swt interactive chart 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.interactivity;

import org.eclipse.birt.chart.device.ICallBackNotifier;
import org.eclipse.birt.chart.device.IDeviceRenderer;
import org.eclipse.birt.chart.exception.ChartException;
import org.eclipse.birt.chart.factory.GeneratedChartState;
import org.eclipse.birt.chart.factory.Generator;
import org.eclipse.birt.chart.model.Chart;
import org.eclipse.birt.chart.model.attribute.Bounds;
import org.eclipse.birt.chart.model.attribute.CallBackValue;
import org.eclipse.birt.chart.model.attribute.impl.BoundsImpl;
import org.eclipse.birt.chart.util.PluginSettings;
import org.eclipse.birt.core.framework.PlatformConfig;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.PaintEvent;
import org.eclipse.swt.events.PaintListener;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.layout.RowLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.MessageBox;
import org.eclipse.swt.widgets.Shell;

/**
* The selector of charts in SWT.
*
*/
public final class SwtInteractivityViewer extends Composite implements
PaintListener,
ICallBackNotifier,
SelectionListener
{
private IDeviceRenderer idr = null;

private Chart cm = null;

private static Combo cbType = null;

private static Button btn = null;

private GeneratedChartState gcs = null;

private boolean bNeedsGeneration = true;

/**
* 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( ) );

SwtInteractivityViewer siv = new SwtInteractivityViewer( shell,
SWT.NO_BACKGROUND );
siv.setLayoutData( new GridData( GridData.FILL_BOTH ) );
siv.addPaintListener( siv );

Composite cBottom = new Composite( shell, SWT.NONE );
cBottom.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
cBottom.setLayout( new RowLayout( ) );

Label la = new Label( cBottom, SWT.NONE );

la.setText( "Choose: " );//$NON-NLS-1$
cbType = new Combo( cBottom, SWT.DROP_DOWN | SWT.READ_ONLY );
cbType.add( "Highlight Series" );//$NON-NLS-1$
cbType.add( "Show Tooltip" );//$NON-NLS-1$
cbType.add( "Toggle Visibility" );//$NON-NLS-1$
cbType.add( "URL Redirect" );//$NON-NLS-1$
cbType.add( "Multiple URLs Redirect" );//$NON-NLS-1$
cbType.add( "Call Back" );//$NON-NLS-1$
cbType.add( "Right Mouse Click" );//$NON-NLS-1$
cbType.add( "Mouse Cursor");//$NON-NLS-1$
cbType.select( 0 );

btn = new Button( cBottom, SWT.NONE );
btn.setText( "Update" );//$NON-NLS-1$
btn.addSelectionListener( siv );

shell.open( );
while ( !shell.isDisposed( ) )
{
if ( !display.readAndDispatch( ) )
display.sleep( );
}
display.dispose( );
}

/**
* Get the connection with SWT device to render the graphics.
*/
SwtInteractivityViewer( Composite parent, int style )
{
super( parent, style );

PlatformConfig config = new PlatformConfig( );
config.setProperty( "STANDALONE", "true" ); //$NON-NLS-1$ //$NON-NLS-2$
final PluginSettings ps = PluginSettings.instance( config );
try
{
idr = ps.getDevice( "dv.SWT" );//$NON-NLS-1$
idr.setProperty( IDeviceRenderer.UPDATE_NOTIFIER, this );
}
catch ( ChartException ex )
{
ex.printStackTrace( );
}
cm = InteractivityCharts.createHSChart( );
}

/*
* (non-Javadoc)
*
* @see
org.eclipse.swt.events.PaintListener#paintControl(org.eclips e.swt.events.PaintEvent)
*/
public void paintControl( PaintEvent e )
{
Rectangle d = this.getClientArea( );
Image imgChart = new Image( this.getDisplay( ), d );
GC gcImage = new GC( imgChart );
idr.setProperty( IDeviceRenderer.GRAPHICS_CONTEXT, gcImage );

Bounds bo = BoundsImpl.create( 0, 0, d.width, d.height );
bo.scale( 72d / idr.getDisplayServer( ).getDpiResolution( ) );

Generator gr = Generator.instance( );
if ( bNeedsGeneration )
{
bNeedsGeneration = false;
try
{
gcs = gr.build( idr.getDisplayServer( ),
cm,
bo,
null,
null,
null );
}
catch ( ChartException ce )
{
ce.printStackTrace( );
}
}

try
{
gr.render( idr, gcs );
GC gc = e.gc;
gc.drawImage( imgChart, d.x, d.y );
}
catch ( ChartException ce )
{
ce.printStackTrace( );
}
}

/*
* (non-Javadoc)
*
* @see
org.eclipse.swt.events.SelectionListener#widgetSelected(org. eclipse.swt.events.SelectionEvent)
*/
public void widgetSelected( SelectionEvent e )
{
if ( e.widget.equals( btn ) )
{
int iSelection = cbType.getSelectionIndex( );
switch ( iSelection )
{
case 0 :
cm = InteractivityCharts.createHSChart( );
break;
case 1 :
cm = InteractivityCharts.createSTChart( );
break;
case 2 :
cm = InteractivityCharts.createTVChart( );
break;
case 3 :
cm = InteractivityCharts.createURChart( );
break;
case 4 :
cm = InteractivityCharts.createMultiURChart( );
break;
case 5 :
cm = InteractivityCharts.createCBChart( );
break;
case 6 :
cm = InteractivityCharts.createRCChart( );
break;
case 7 :
cm = InteractivityCharts.createBarChartWithCursorExample( );
break;
}
bNeedsGeneration = true;
this.redraw( );
}
}

/*
* (non-Javadoc)
*
* @see
org.eclipse.swt.events.SelectionListener#widgetDefaultSelect ed(org.eclipse.swt.events.SelectionEvent)
*/
public void widgetDefaultSelected( SelectionEvent e )
{
// TODO Auto-generated method stub
}

/*
* (non-Javadoc)
*
* @see
org.eclipse.birt.chart.device.swing.IUpdateNotifier#getDesig nTimeModel()
*/
public Chart getDesignTimeModel( )
{
return cm;
}

/*
* (non-Javadoc)
*
* @see
org.eclipse.birt.chart.device.swing.IUpdateNotifier#getRunTi meModel()
*/
public Chart getRunTimeModel( )
{
return gcs.getChartModel( );
}

public Object peerInstance( )
{
return this;
}

public void regenerateChart( )
{
bNeedsGeneration = true;
redraw( );
}

public void repaintChart( )
{
redraw( );
}



public void callback( Object event, Object source, CallBackValue value )
{
MessageBox mb = new MessageBox ( this.getShell( ) );
mb.setMessage( value.getIdentifier( ) );
mb.open( );
}

}



On 5/7/2010 3:40 AM, Martin wrote:
> Hi,
>
> i'am currently developing an Eclipse RCP application and use the BIRT
> Chart Engine API to visualize some data.
> I need to possibility to zoom in and out my charts. Can someone give me
> an example how to implement this.
> Or to help me, developing an own implementation: - how can I get the
> bounds of the client area (chart.getPlot.getClientArea()) - how can I
> scale my chart. (e.g. x-axis from 15 to 25, instead of 0 to 100)
> - is it possible to write an mouse move/ mouse down/ mouse up event
> handler in Java and get the coords of the cursor.
> Thanks in advance!
> -- Martin
>
Re: Chart Engine API - how to implement zoom [message #532435 is a reply to message #532273] Mon, 10 May 2010 00:17 Go to previous messageGo to next message
Martin Lange is currently offline Martin LangeFriend
Messages: 16
Registered: May 2010
Location: Munich, Germany
Junior Member

Jason,

the SVG Zoom capability isn't enough for me. It is just like an image zoom, if I zoom in, I can't see the axes anymore.

I've seen the SwtInteractiveViewer example. If I set a callback on a series, it fires only if I click on the series itself and not if I click somewhere in the grid.

I think I need something like a recalculation from the x, y of the composite and the coordinates in the grid.

Any ideas out there?

-- Martin
Re: Chart Engine API - how to implement zoom [message #532659 is a reply to message #532435] Mon, 10 May 2010 16:59 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Martin,

Can you try and put the event on the chart area instead of the series?

Jason

On 5/9/2010 8:17 PM, Martin wrote:
> Jason,
>
> the SVG Zoom capability isn't enough for me. It is just like an image
> zoom, if I zoom in, I can't see the axes anymore.
> I've seen the SwtInteractiveViewer example. If I set a callback on a
> series, it fires only if I click on the series itself and not if I click
> somewhere in the grid.
>
> I think I need something like a recalculation from the x, y of the
> composite and the coordinates in the grid.
>
> Any ideas out there?
>
> -- Martin
Re: Chart Engine API - how to implement zoom [message #537392 is a reply to message #532659] Wed, 02 June 2010 09:48 Go to previous messageGo to next message
No real name is currently offline No real nameFriend
Messages: 1
Registered: June 2010
Junior Member
Hi Jason,
I have the same problem like Martin, can you post an example how to set an event on the chart area? Or is there any other possibility to get the positions of the axes?
Regards
Re: Chart Engine API - how to implement zoom [message #537445 is a reply to message #537392] Wed, 02 June 2010 13:26 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

You should be able to use something like
cwaBar.getPlot().getTriggers....

BTW I attached is an example (work in progress!!!!) report that uses to
client side script to re-run a report zoomed when you click on two
points on the y-axis.

Jason



<?xml version="1.0" encoding="UTF-8"?>
<report xmlns="http://www.eclipse.org/birt/2005/design" version="3.2.21"
id="1">
<property name="comments">Copyright (c) 2007 &lt;&lt;Your Company
Name here>></property>
<property name="createdBy">Eclipse BIRT Designer Version
2.5.2.v20100208 Build &lt;2.5.2.v20100210-0630></property>
<html-property name="description">Creates a blank report with no
predefined content.</html-property>
<property name="units">in</property>
<text-property name="displayName">Blank Report</text-property>
<property name="iconFile">/templates/blank_report.gif</property>
<property name="layoutPreference">auto layout</property>
<parameters>
<scalar-parameter name="minScale" id="106">
<property name="valueType">static</property>
<property name="dataType">string</property>
<property name="distinct">true</property>
<simple-property-list name="defaultValue">
<value type="constant">70</value>
</simple-property-list>
<property name="paramType">simple</property>
<property name="controlType">text-box</property>
<structure name="format">
<property name="category">Unformatted</property>
</structure>
</scalar-parameter>
<scalar-parameter name="maxScale" id="107">
<property name="valueType">static</property>
<property name="dataType">string</property>
<property name="distinct">true</property>
<simple-property-list name="defaultValue">
<value type="constant">110</value>
</simple-property-list>
<property name="paramType">simple</property>
<property name="controlType">text-box</property>
<structure name="format">
<property name="category">Unformatted</property>
</structure>
</scalar-parameter>
</parameters>
<data-sources>
<oda-data-source
extensionID="org.eclipse.birt.report.data.oda.jdbc" name="Data Source"
id="6">
<property
name="odaDriverClass">org.eclipse.birt.report.data.oda.sampledb.Driver </property>
<property name="odaURL">jdbc:classicmodels:sampledb</property>
<property name="odaUser">ClassicModels</property>
</oda-data-source>
</data-sources>
<data-sets>
<oda-data-set
extensionID="org.eclipse.birt.report.data.oda.jdbc.JdbcSelectDataSet "
name="Data Set" id="7">
<list-property name="columnHints">
<structure>
<property name="columnName">ORDERNUMBER</property>
<text-property
name="displayName">ORDERNUMBER</text-property>
</structure>
<structure>
<property name="columnName">PRODUCTCODE</property>
<text-property
name="displayName">PRODUCTCODE</text-property>
</structure>
<structure>
<property name="columnName">QUANTITYORDERED</property>
<text-property
name="displayName">QUANTITYORDERED</text-property>
</structure>
<structure>
<property name="columnName">PRICEEACH</property>
<text-property
name="displayName">PRICEEACH</text-property>
</structure>
<structure>
<property name="columnName">ORDERLINENUMBER</property>
<text-property
name="displayName">ORDERLINENUMBER</text-property>
</structure>
</list-property>
<structure name="cachedMetaData">
<list-property name="resultSet">
<structure>
<property name="position">1</property>
<property name="name">ORDERNUMBER</property>
<property name="dataType">integer</property>
</structure>
<structure>
<property name="position">2</property>
<property name="name">PRODUCTCODE</property>
<property name="dataType">string</property>
</structure>
<structure>
<property name="position">3</property>
<property name="name">QUANTITYORDERED</property>
<property name="dataType">integer</property>
</structure>
<structure>
<property name="position">4</property>
<property name="name">PRICEEACH</property>
<property name="dataType">float</property>
</structure>
<structure>
<property name="position">5</property>
<property name="name">ORDERLINENUMBER</property>
<property name="dataType">integer</property>
</structure>
</list-property>
</structure>
<property name="dataSource">Data Source</property>
<list-property name="resultSet">
<structure>
<property name="position">1</property>
<property name="name">ORDERNUMBER</property>
<property name="nativeName">ORDERNUMBER</property>
<property name="dataType">integer</property>
<property name="nativeDataType">4</property>
</structure>
<structure>
<property name="position">2</property>
<property name="name">PRODUCTCODE</property>
<property name="nativeName">PRODUCTCODE</property>
<property name="dataType">string</property>
<property name="nativeDataType">12</property>
</structure>
<structure>
<property name="position">3</property>
<property name="name">QUANTITYORDERED</property>
<property name="nativeName">QUANTITYORDERED</property>
<property name="dataType">integer</property>
<property name="nativeDataType">4</property>
</structure>
<structure>
<property name="position">4</property>
<property name="name">PRICEEACH</property>
<property name="nativeName">PRICEEACH</property>
<property name="dataType">float</property>
<property name="nativeDataType">8</property>
</structure>
<structure>
<property name="position">5</property>
<property name="name">ORDERLINENUMBER</property>
<property name="nativeName">ORDERLINENUMBER</property>
<property name="dataType">integer</property>
<property name="nativeDataType">5</property>
</structure>
</list-property>
<xml-property name="queryText"><![CDATA[select *
from orderdetails]]></xml-property>
<xml-property name="designerValues"><![CDATA[<?xml
version="1.0" encoding="UTF-8"?>
<model:DesignValues
xmlns:design="http://www.eclipse.org/datatools/connectivity/oda/design"
xmlns:model="http://www.eclipse.org/birt/report/model/adapter/odaModel">
<Version>1.0</Version>
<design:ResultSets derivedMetaData="true">
<design:resultSetDefinitions>
<design:resultSetColumns>
<design:resultColumnDefinitions>
<design:attributes>
<design:name>ORDERNUMBER</design:name>
<design:position>1</design:position>
<design:nativeDataTypeCode>4</design:nativeDataTypeCode>
<design:precision>10</design:precision>
<design:scale>0</design:scale>
<design:nullability>Nullable</design:nullability>
<design:uiHints>
<design:displayName>ORDERNUMBER</design:displayName>
</design:uiHints>
</design:attributes>
<design:usageHints>
<design:label>ORDERNUMBER</design:label>
<design:formattingHints>
<design:displaySize>11</design:displaySize>
</design:formattingHints>
</design:usageHints>
</design:resultColumnDefinitions>
<design:resultColumnDefinitions>
<design:attributes>
<design:name>PRODUCTCODE</design:name>
<design:position>2</design:position>
<design:nativeDataTypeCode>12</design:nativeDataTypeCode>
<design:precision>15</design:precision>
<design:scale>0</design:scale>
<design:nullability>Nullable</design:nullability>
<design:uiHints>
<design:displayName>PRODUCTCODE</design:displayName>
</design:uiHints>
</design:attributes>
<design:usageHints>
<design:label>PRODUCTCODE</design:label>
<design:formattingHints>
<design:displaySize>15</design:displaySize>
</design:formattingHints>
</design:usageHints>
</design:resultColumnDefinitions>
<design:resultColumnDefinitions>
<design:attributes>
<design:name>QUANTITYORDERED</design:name>
<design:position>3</design:position>
<design:nativeDataTypeCode>4</design:nativeDataTypeCode>
<design:precision>10</design:precision>
<design:scale>0</design:scale>
<design:nullability>Nullable</design:nullability>
<design:uiHints>
<design:displayName>QUANTITYORDERED</design:displayName>
</design:uiHints>
</design:attributes>
<design:usageHints>
<design:label>QUANTITYORDERED</design:label>
<design:formattingHints>
<design:displaySize>11</design:displaySize>
</design:formattingHints>
</design:usageHints>
</design:resultColumnDefinitions>
<design:resultColumnDefinitions>
<design:attributes>
<design:name>PRICEEACH</design:name>
<design:position>4</design:position>
<design:nativeDataTypeCode>8</design:nativeDataTypeCode>
<design:precision>15</design:precision>
<design:scale>0</design:scale>
<design:nullability>Nullable</design:nullability>
<design:uiHints>
<design:displayName>PRICEEACH</design:displayName>
</design:uiHints>
</design:attributes>
<design:usageHints>
<design:label>PRICEEACH</design:label>
<design:formattingHints>
<design:displaySize>22</design:displaySize>
</design:formattingHints>
</design:usageHints>
</design:resultColumnDefinitions>
<design:resultColumnDefinitions>
<design:attributes>
<design:name>ORDERLINENUMBER</design:name>
<design:position>5</design:position>
<design:nativeDataTypeCode>5</design:nativeDataTypeCode>
<design:precision>5</design:precision>
<design:scale>0</design:scale>
<design:nullability>Nullable</design:nullability>
<design:uiHints>
<design:displayName>ORDERLINENUMBER</design:displayName>
</design:uiHints>
</design:attributes>
<design:usageHints>
<design:label>ORDERLINENUMBER</design:label>
<design:formattingHints>
<design:displaySize>6</design:displaySize>
</design:formattingHints>
</design:usageHints>
</design:resultColumnDefinitions>
</design:resultSetColumns>
</design:resultSetDefinitions>
</design:ResultSets>
</model:DesignValues>]]></xml-property>
</oda-data-set>
</data-sets>
<styles>
<style name="crosstab" id="4">
<property name="borderBottomColor">#CCCCCC</property>
<property name="borderBottomStyle">solid</property>
<property name="borderBottomWidth">1pt</property>
<property name="borderLeftColor">#CCCCCC</property>
<property name="borderLeftStyle">solid</property>
<property name="borderLeftWidth">1pt</property>
<property name="borderRightColor">#CCCCCC</property>
<property name="borderRightStyle">solid</property>
<property name="borderRightWidth">1pt</property>
<property name="borderTopColor">#CCCCCC</property>
<property name="borderTopStyle">solid</property>
<property name="borderTopWidth">1pt</property>
</style>
<style name="crosstab-cell" id="5">
<property name="borderBottomColor">#CCCCCC</property>
<property name="borderBottomStyle">solid</property>
<property name="borderBottomWidth">1pt</property>
<property name="borderLeftColor">#CCCCCC</property>
<property name="borderLeftStyle">solid</property>
<property name="borderLeftWidth">1pt</property>
<property name="borderRightColor">#CCCCCC</property>
<property name="borderRightStyle">solid</property>
<property name="borderRightWidth">1pt</property>
<property name="borderTopColor">#CCCCCC</property>
<property name="borderTopStyle">solid</property>
<property name="borderTopWidth">1pt</property>
</style>
<style name="detail" id="57">
<property name="backgroundColor">#BACAE2</property>
<property name="fontFamily">"Arial"</property>
<property name="fontSize">small</property>
<property name="paddingTop">0px</property>
<property name="paddingLeft">0px</property>
<property name="paddingBottom">0px</property>
<property name="paddingRight">0px</property>
</style>
<style name="headerfooter" id="58">
<property name="backgroundColor">#004080</property>
<property name="fontFamily">"Arial"</property>
<property name="fontSize">small</property>
<property name="fontWeight">bold</property>
<property name="color">#FFFFFF</property>
</style>
<style name="groupheader" id="59">
<property name="backgroundColor">#0080FF</property>
<property name="fontFamily">"Arial"</property>
<property name="fontSize">small</property>
<property name="fontWeight">bold</property>
<property name="color">#FFFFFF</property>
</style>
<style name="myrb" id="67">
<property name="backgroundAttachment">fixed</property>
<property name="backgroundColor">#FF8080</property>
<property name="borderBottomStyle">dashed</property>
<property name="borderLeftStyle">dashed</property>
<property name="borderRightStyle">dashed</property>
<property name="borderTopStyle">dashed</property>
<property name="whiteSpace">pre</property>
<property name="display">inline</property>
</style>
<style name="NewStyle" id="77">
<property name="display">inline</property>
</style>
<style name="NewStyle1" id="93">
<property name="canShrink">true</property>
</style>
</styles>
<page-setup>
<simple-master-page name="Simple MasterPage" id="2">
<property name="topMargin">1in</property>
<property name="leftMargin">1.25in</property>
<property name="bottomMargin">1in</property>
<property name="rightMargin">1.25in</property>
</simple-master-page>
</page-setup>
<body>
<extended-item extensionName="Chart" name="NewChart" id="8">
<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>Bar Chart</Type>
<SubType>Side-by-side</SubType>
<Description>
<Value></Value>
<Font>
<Alignment/>
</Font>
</Description>
<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>Bar Chart Title</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>
<Background xsi:type="attribute:ColorDefinition">
<Transparency>0</Transparency>
<Red>255</Red>
<Green>255</Green>
<Blue>255</Blue>
</Background>
<Visible>true</Visible>
<HorizontalSpacing>5</HorizontalSpacing>
<VerticalSpacing>5</VerticalSpacing>
<ClientArea>
<Background xsi:type="attribute:ColorDefinition">
<Transparency>0</Transparency>
<Red>255</Red>
<Green>255</Green>
<Blue>255</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>
<Triggers>
<Condition>onmouseover</Condition>
<Action>
<Type>Show_Tooltip</Type>
<Value xsi:type="attribute:TooltipValue">
<Text>mouseover</Text>
<Delay>200</Delay>
</Value>
</Action>
</Triggers>
<Triggers>
<Condition>onclick</Condition>
<Action>
<Type>Highlight</Type>
<Value xsi:type="attribute:SeriesValue">
<Name></Name>
</Value>
</Action>
</Triggers>
<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>Categories</ItemType>
<Title>
<Caption>
<Value>dfsdf</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>
</Title>
<TitlePosition>Above</TitlePosition>
<ShowValue>true</ShowValue>
</Children>
<Bounds>
<Left>0.0</Left>
<Top>0.0</Top>
<Width>442.49999999759996</Width>
<Height>246.7499999976</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>true</Visible>
</Outline>
<Visible>true</Visible>
<Triggers>
<Condition>onclick</Condition>
<Action>
<Type>Invoke_Script</Type>
<Value xsi:type="attribute:ScriptValue">
<Script>startRubber(evt);</Script>
</Value>
</Action>
</Triggers>
<Triggers>
<Condition>onmousemove</Condition>
<Action>
<Type>Invoke_Script</Type>
<Value xsi:type="attribute:ScriptValue">
<Script></Script>
</Value>
</Action>
</Triggers>
<Triggers>
<Condition>onmousedown</Condition>
<Action>
<Type>Invoke_Script</Type>
<Value xsi:type="attribute:ScriptValue">
<Script>startRubber(evt);&#xD;
&#xD;
</Script>
</Value>
</Action>
</Triggers>
<Triggers>
<Condition>onmouseup</Condition>
<Action>
<Type>Invoke_Script</Type>
<Value xsi:type="attribute:ScriptValue">
<Script>stopRubber(evt); &#xD;
</Script>
</Value>
</Action>
</Triggers>
<Triggers>
<Condition>ondblclick</Condition>
<Action>
<Type>Invoke_Script</Type>
<Value xsi:type="attribute:ScriptValue">
<Script></Script>
</Value>
</Action>
</Triggers>
</Block>
<Dimension>Two_Dimensional</Dimension>
<Script>var topy=0;
var bottomy=0;
var scalemax=0;
var scalemin=9999999;

function beforeGeneration(chart, icsc)
{
importPackage( Packages.org.eclipse.birt.chart.model.data.impl );
xAxis = chart.getBaseAxes()[0];
yAxis = chart.getOrthogonalAxes( xAxis, true)[0]
yscale = yAxis.getScale();
yscale.setMin(
NumberDataElementImpl.create(icsc.getExternalContext().getSc riptable().getParameterValue(&quot;minScale&quot;))
);
yscale.setMax(
NumberDataElementImpl.create(icsc.getExternalContext().getSc riptable().getParameterValue(&quot;maxScale&quot;))
);
yAxis.setScale(yscale);

}

function beforeDrawAxisLabel( axis, label, icsc )
{
importPackage(Packages.org.eclipse.birt.chart.model.attribut e);
importPackage( Packages.java.lang );
if (axis.getType() == AxisType.LINEAR_LITERAL){
var curr = parseFloat(label.getCaption().getValue());
if( curr > scalemax){
scalemax=curr;
}
if( curr &lt; scalemin){
scalemin=curr;
}
}
}


function beforeDrawBlock( block, icsc )
{
if( block.isPlot() ){
topy = block.getBounds().getTop()+50;
bottomy =
block.getBounds().getHeight()+block.getBounds().getTop()+30;
}
}


function afterRendering( gcs, icsc )
{
var slp = (scalemax-scalemin)/(bottomy-topy);

icsc.getExternalContext().getScriptable().setGlobalVariable( &quot;scaleSlope&quot;,slp);

icsc.getExternalContext().getScriptable().setGlobalVariable( &quot;scaleMin&quot;,scalemin);

icsc.getExternalContext().getScriptable().setGlobalVariable( &quot;scaleMinY&quot;,bottomy);
}
</Script>
<Units>Points</Units>
<SeriesThickness>10.0</SeriesThickness>
<SampleData>
<BaseSampleData>
<DataSetRepresentation>'A','B','C'</DataSetRepresentation>
</BaseSampleData>
<OrthogonalSampleData>
<DataSetRepresentation>5.0,4.0,12.0</DataSetRepresentation >
<SeriesDefinitionIndex>0</SeriesDefinitionIndex>
</OrthogonalSampleData>
<AncillarySampleData>
<DataSetRepresentation>Series 1</DataSetRepresentation>
</AncillarySampleData>
</SampleData>
<Interactivity>
<LegendBehavior>HighlightSerie</LegendBehavior>
</Interactivity>
<EmptyMessage>
<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>
</Outline>
<Insets>
<Top>0.0</Top>
<Left>2.0</Left>
<Bottom>0.0</Bottom>
<Right>3.0</Right>
</Insets>
<Visible>false</Visible>
</EmptyMessage>
<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>
<Rotation>0.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>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:BarSeries">
<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[&quot;QUANTITYORDERED&quot;]</Definition >
</DataDefinition>
<SeriesIdentifier></SeriesIdentifier>
<DataPoint>
<Components>
<Type>Orthogonal_Value</Type>
</Components>
<Separator>, </Separator>
</DataPoint>
<LabelPosition>Outside</LabelPosition>
<Stacked>false</Stacked>
<Triggers>
<Condition>onmouseover</Condition>
<Action>
<Type>Show_Tooltip</Type>
<Value xsi:type="attribute:TooltipValue">
<Text>row[&quot;PRODUCTCODE&quot;] + &quot;, &quot;
+row[&quot;QUANTITYORDERED&quot;]</Text>
<Delay>200</Delay>
</Value>
</Action>
</Triggers>
<Riser>Rectangle</Riser>
</Series>
<Grouping>
<Enabled>false</Enabled>
<GroupingInterval>2.0</GroupingInterval>
<GroupType>Text</GroupType>
<AggregateExpression>Sum</AggregateExpression>
</Grouping>
<Sorting>Ascending</Sorting>
</SeriesDefinitions>
<Orientation>Vertical</Orientation>
<LineAttributes>
<Style>Solid</Style>
<Thickness>1</Thickness>
<Color>
<Transparency>255</Transparency>
<Red>0</Red>
<Green>0</Green>
<Blue>0</Blue>
</Color>
<Visible>true</Visible>
</LineAttributes>
<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>
</Outline>
<Insets>
<Top>0.0</Top>
<Left>2.0</Left>
<Bottom>0.0</Bottom>
<Right>3.0</Right>
</Insets>
<Visible>true</Visible>
</Label>
<FormatSpecifier xsi:type="attribute:NumberFormatSpecifier">
<Prefix></Prefix>
<Suffix></Suffix>
<FractionDigits>2</FractionDigits>
</FormatSpecifier>
<LabelPosition>Left</LabelPosition>
<MajorGrid>
<LineAttributes>
<Style>Solid</Style>
<Thickness>1</Thickness>
<Color>
<Transparency>255</Transparency>
<Red>196</Red>
<Green>196</Green>
<Blue>196</Blue>
</Color>
<Visible>false</Visible>
</LineAttributes>
<TickStyle>Across</TickStyle>
<TickAttributes>
<Style>Solid</Style>
<Thickness>1</Thickness>
<Color>
<Transparency>255</Transparency>
<Red>196</Red>
<Green>196</Green>
<Blue>196</Blue>
</Color>
<Visible>true</Visible>
</TickAttributes>
</MajorGrid>
<MinorGrid>
<LineAttributes>
<Style>Solid</Style>
<Thickness&
Re: Chart Engine API - how to implement zoom [message #551244 is a reply to message #537445] Thu, 05 August 2010 17:26 Go to previous messageGo to next message
No real name is currently offline No real nameFriend
Messages: 23
Registered: August 2010
Junior Member
Hi,

I also have a problem when using the callback implementation to zoom (by rescaling and redrawing). After I do setStep() inside the callback, my charts are not refreshed to the newly zoomed scale.

I tried explicitly calling gr.refresh(state), but the charts are not zooming. I am attaching my snippet here:

@Override
public void callback(Object event, Object source, CallBackValue value) {
Axis xAxis = ( (ChartWithAxes)((ChartCanvas)((MouseEvent)event).getSource() ).getChart()).getPrimaryBaseAxes()[0];
System.out.println("Factor " + xAxis.getScale().getFactor() );
xAxis.getScale().setStep(0.01);
Axis yAxis = ( (ChartWithAxes)((ChartCanvas)((MouseEvent)event).getSource() ).getChart()).getPrimaryOrthogonalAxis(xAxis);
yAxis.getScale().setStep(0.01);
System.out.println("Step " + xAxis.getScale().getStep() + " " + yAxis.getScale().getStep());

try {
Generator gr = Generator.instance();
gr.render(render, state);
} catch(ChartException e) {
e.printStackTrace();
}

}
Re: Chart Engine API - how to implement zoom [message #551267 is a reply to message #551244] Thu, 05 August 2010 18:32 Go to previous messageGo to next message
No real name is currently offline No real nameFriend
Messages: 23
Registered: August 2010
Junior Member
Also are there any new zoom feature in the latest BIRT version?
Re: Chart Engine API - how to implement zoom [message #551459 is a reply to message #551267] Fri, 06 August 2010 14:10 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

I do not think so, but I think this would be a good enhancement request.
Would you mind logging it to bugzilla?

Jason

On 8/5/2010 2:32 PM, asadanandan@axiomainc.com wrote:
> Also are there any new zoom feature in the latest BIRT version?
Re: Chart Engine API - how to implement zoom [message #551461 is a reply to message #551459] Fri, 06 August 2010 14:23 Go to previous messageGo to next message
No real name is currently offline No real nameFriend
Messages: 23
Registered: August 2010
Junior Member
Sure . And I am also reposting my previous question here . Would you know why the zoom refresh does not work ?-


I also have a problem when using the callback implementation to zoom (by rescaling and redrawing). After I do setStep() inside the callback, my charts are not refreshed to the newly zoomed scale.

I tried explicitly calling gr.refresh(state), but the charts are not zooming. I am attaching my snippet here:

@Override
public void callback(Object event, Object source, CallBackValue value) {
Axis xAxis = ( (ChartWithAxes)((ChartCanvas)((MouseEvent)event).getSource() ).getChart()).getPrimaryBaseAxes()[0];
System.out.println("Factor " + xAxis.getScale().getFactor() );
xAxis.getScale().setStep(0.01);
Axis yAxis = ( (ChartWithAxes)((ChartCanvas)((MouseEvent)event).getSource() ).getChart()).getPrimaryOrthogonalAxis(xAxis);
yAxis.getScale().setStep(0.01);
System.out.println("Step " + xAxis.getScale().getStep() + " " + yAxis.getScale().getStep());

try {
Generator gr = Generator.instance();
gr.render(render, state);
} catch(ChartException e) {
e.printStackTrace();
}

}


Thanks,
Re: Chart Engine API - how to implement zoom [message #551474 is a reply to message #551461] Fri, 06 August 2010 14:29 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

I believe if you change the scale the chart has to do a rebuild. Have
you tried running build again?

On 8/6/2010 10:23 AM, asadanandan@axiomainc.com wrote:
> Sure . And I am also reposting my previous question here . Would you
> know why the zoom refresh does not work ?-
>
>
> I also have a problem when using the callback implementation to zoom (by
> rescaling and redrawing). After I do setStep() inside the callback, my
> charts are not refreshed to the newly zoomed scale.
>
> I tried explicitly calling gr.refresh(state), but the charts are not
> zooming. I am attaching my snippet here:
>
> @Override
> public void callback(Object event, Object source, CallBackValue value) {
> Axis xAxis = (
> (ChartWithAxes)((ChartCanvas)((MouseEvent)event).getSource()
> ).getChart()).getPrimaryBaseAxes()[0];
> System.out.println("Factor " + xAxis.getScale().getFactor() );
> xAxis.getScale().setStep(0.01);
> Axis yAxis = (
> (ChartWithAxes)((ChartCanvas)((MouseEvent)event).getSource()
> ).getChart()).getPrimaryOrthogonalAxis(xAxis);
> yAxis.getScale().setStep(0.01);
> System.out.println("Step " + xAxis.getScale().getStep() + " " +
> yAxis.getScale().getStep());
>
> try {
> Generator gr = Generator.instance();
> gr.render(render, state);
> } catch(ChartException e) {
> e.printStackTrace();
> }
>
> }
>
> Thanks,
Re: Chart Engine API - how to implement zoom [message #551476 is a reply to message #551474] Fri, 06 August 2010 14:54 Go to previous messageGo to next message
No real name is currently offline No real nameFriend
Messages: 23
Registered: August 2010
Junior Member
Yes that worked, thanks a lot Jason!!
Re: Chart Engine API - how to implement zoom [message #552613 is a reply to message #551476] Thu, 12 August 2010 19:57 Go to previous message
No real name is currently offline No real nameFriend
Messages: 23
Registered: August 2010
Junior Member
Hi Jason,
Do you have any sample code for zooming along the XAxis which has TextDataSet - in terms of resetting Min and Max scale along the axis?

Thanks
Previous Topic:watermark and company stamp
Next Topic:subtotals for multipage tables
Goto Forum:
  


Current Time: Fri Nov 21 12:36:03 GMT 2014

Powered by FUDForum. Page generated in 0.02098 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software