Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » Alignment of labels for meter chart
Alignment of labels for meter chart [message #643344] Mon, 06 December 2010 10:18 Go to next message
Eclipse User
Originally posted by: anders.hessellund.gmail.com

This is a multi-part message in MIME format.
--------------010409040809080904040905
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Hi,

I've been playing with the BIRT examples plugin and in particular the
meter chart. It is all very impressive! One annoying detail, though, is
that labels do not seem to be visually "attached" to their corresponding
tick mark in the middle of the meter (see Screenshot).

Does anyone have an idea how this can be solved?

public static final Chart createMDialSRegionChart( )
{
final DialChart dChart = (DialChart) DialChartImpl.create( );
dChart.setDialSuperimposition( false );
dChart.setGridColumnCount( 2 );
dChart.setSeriesThickness( 25 );

// Title/Plot
dChart.getBlock( ).setBackground( ColorDefinitionImpl.WHITE( ) );
final Plot p = dChart.getPlot( );
p.getClientArea( ).setBackground( null );
p.getClientArea( ).getOutline( ).setVisible( false );
p.getOutline( ).setVisible( false );

dChart.getTitle( ).getLabel( ).getCaption( ).setValue( "Meter Chart
TEST" );//$NON-NLS-1$
dChart.getTitle( ).getOutline( ).setVisible( false );

// Legend
final Legend lg = dChart.getLegend( );
final LineAttributes lia = lg.getOutline( );
lg.getText( ).getFont( ).setSize( 16 );
lia.setStyle( LineStyle.SOLID_LITERAL );
lg.getInsets( ).setLeft( 10 );
lg.getInsets( ).setRight( 10 );
lg.setBackground( null );
lg.getOutline( ).setVisible( false );
lg.setShowValue( false );
lg.getClientArea( ).setBackground( ColorDefinitionImpl.PINK( ) );

lg.getClientArea( ).getOutline( ).setVisible( true );
lg.getTitle( ).getCaption( ).getFont( ).setSize( 20 );
lg.getTitle( ).setInsets( InsetsImpl.create( 10, 10, 10, 10 ) );
lg.setTitlePosition( Position.ABOVE_LITERAL );
lg.setItemType( LegendItemType.SERIES_LITERAL );

// Data Set
final TextDataSet categoryValues = TextDataSetImpl.create( new String[]{
"Speed"} );//$NON-NLS-1$

final SeriesDefinition sdBase = SeriesDefinitionImpl.create( );
dChart.getSeriesDefinitions( ).add( sdBase );

final Series seCategory = SeriesImpl.create( );
seCategory.setDataSet( categoryValues );
sdBase.getSeries( ).add( seCategory );

final SeriesDefinition sdOrth = SeriesDefinitionImpl.create( );

final Fill[] fiaOrth = {
ColorDefinitionImpl.ORANGE( ),
ColorDefinitionImpl.RED( ),
ColorDefinitionImpl.GREEN( )
};

sdOrth.getSeriesPalette( ).getEntries( ).clear( );
for (final Fill element : fiaOrth) {
sdOrth.getSeriesPalette( ).getEntries( ).add( element );
}

// Dial 1
final DialSeries seDial1 = (DialSeries) DialSeriesImpl.create( );
seDial1.setDataSet( NumberDataSetImpl.create( new double[]{
60
} ) );
seDial1.getDial( )
.setFill( GradientImpl.create( ColorDefinitionImpl.create( 125,
125,
255 ),
ColorDefinitionImpl.create( 255, 255, 225 ),
-35,
false ) );
seDial1.getNeedle( ).setDecorator( LineDecorator.ARROW_LITERAL );

seDial1.getNeedle().setLineAttributes(LineAttributesImpl.cre ate(ColorDefinitionImpl.ORANGE(),
LineStyle.SOLID_LITERAL, 4));
seDial1.getDial( )
.getMinorGrid( )
.getTickAttributes( )
.setVisible( false );
final Label tickLabel = LabelImpl.create();
final TextAlignment ta = TextAlignmentImpl.create();
ta.setHorizontalAlignment(HorizontalAlignment.CENTER_LITERAL );
ta.setVerticalAlignment(VerticalAlignment.CENTER_LITERAL);
tickLabel.getCaption().setFont(FontDefinitionImpl.create("Arial ",
5.0f, false, false, false, false, false, 0, ta));
seDial1.getDial().setLabel(tickLabel);
seDial1.getDial().getLabel().setVisible(true);


seDial1.getDial( )
.getMinorGrid( )
.getTickAttributes( )
.setColor( ColorDefinitionImpl.RED( ) );
seDial1.getDial( )
.getMinorGrid( )
.setTickStyle( TickStyle.ACROSS_LITERAL );
seDial1.getDial( ).getScale().setMinorGridsPerUnit( 2 );
seDial1.getDial( )
.getScale( )
.setMin( NumberDataElementImpl.create( 0 ) );
seDial1.getDial( )
.getScale( )
.setMax( NumberDataElementImpl.create( 220 ) );
seDial1.getDial().getScale().setStepNumber(20);

//seDial1.getDial( ).getScale( ).setAutoExpand(true);
seDial1.getLabel( )
.setOutline( LineAttributesImpl.create( ColorDefinitionImpl.YELLOW( )
.darker( ),
LineStyle.SOLID_LITERAL,
1 ) );
seDial1.getLabel( ).setBackground( ColorDefinitionImpl.GREY( )
// .brighter( ) )
.translucent());
seDial1.setSeriesIdentifier( "Speed 1" );//$NON-NLS-1$

dChart.setDialSuperimposition( true );
sdBase.getSeriesDefinitions( ).add( sdOrth );
sdOrth.getSeries( ).add( seDial1 );

return dChart;
}

--------------010409040809080904040905
Content-Type: image/png;
name="sshot-3.png"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="sshot-3.png"

iVBORw0KGgoAAAANSUhEUgAAAOsAAACXCAIAAAB7iDs4AAAAAXNSR0IArs4c 6QAAAARnQU1B
AACxjwv8YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgA ABdwnLpRPAAA
LkBJREFUeF7tnQt0U1W+/+eudeeuuXfumnHNrCt6ZxRnBsXXAMr8RRkFdQQd sKKOMN7hoSDX
1/hARxEcEBwFhYuKDx6KCA7Kq9CWltJ3k7ZJ3y9Kgbb0/U6apEnatHm2/+/J DrsnOY+cpE2a
NOn6rqydndM2PefTb377t397n38ZHh7+QfQregbC9wyA4OhX9AyE7xn4Qfi+ 9eg7j54BJoKI
noXoGQjrMxAlOKwvX/TNRz04ykCYn4GoB4f5BYz4tx8lOOIRCPMTECU4zC9g xL/9KMERj0CY
n4AowWF+ASP+7UcJjngEwvwERAkO8wsY8W8/SnDEIxDmJyBKcJhfwIh/+1GC Ix6BMD8BUYLD
/AJG/NuPEhzxCIT5CYgSHOYXMOLffpTgiEcgzE9AlOAwv4AR//ajBEc8AmF+ AqIEh/kFjPi3
HyU44hEI8xMQJTjML2DEv/0owf4g0NCgO3EiG9q27bvnntvI1gsvbNyz5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HnxQHRg0vmKeYjnGsV4YhubZHvxRCZCpcHlOACs1mx 2yzDdqOQGHz5
P4gleaTvCHq3TG8/02G3u5zYK3/kACOmLu34oMPkJfOFBp6ikg0JHK8/AREw tnbwySCDcHCw
CQZS+ORioybSRnaTHsxuS/x2HAYC7HYSIDJwO2zmYXu/kBw2qzdiRs+c4E/w ChDnAOALeTFO
9gHgFecTPeSRNmDA8Ff2kfi09BAGx6i4CAKRvv6KYBOM94fKE+doF3gJCpaA 84Uv5yTTSFv8
u3hfdV4Y168bsjOjNofDNuwY5JXDjg/T4bGTD3iJs4hZXCCFY1hgMT0+CecB pxTfgtEYOb20
QfpFxEyW4LyE3tc4EAwbdn5mjSEoXn4UuTD4jUMOGzTssAw7zELCAdLfG6oD giX8CQRZ/Eba
9o1gn3D3OBgEhx69zDv6/2CDswm6fk47AAAAAElFTkSuQmCC
--------------010409040809080904040905--
Re: Alignment of labels for meter chart [message #643436 is a reply to message #643344] Mon, 06 December 2010 15:12 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

Anders,

this looks like a bug. If you do not mind can you log it? One thing
that would make it look better is to use an even number of ticks. so in
your case try:

> .setMax( NumberDataElementImpl.create( 220 ) );
> seDial1.getDial().getScale().setStepNumber(22);

Jason

On 12/6/2010 10:18 AM, Anders Hessellund wrote:
> public static final Chart createMDialSRegionChart( )
> {
> final DialChart dChart = (DialChart) DialChartImpl.create( );
> dChart.setDialSuperimposition( false );
> dChart.setGridColumnCount( 2 );
> dChart.setSeriesThickness( 25 );
>
> // Title/Plot
> dChart.getBlock( ).setBackground( ColorDefinitionImpl.WHITE( ) );
> final Plot p = dChart.getPlot( );
> p.getClientArea( ).setBackground( null );
> p.getClientArea( ).getOutline( ).setVisible( false );
> p.getOutline( ).setVisible( false );
>
> dChart.getTitle( ).getLabel( ).getCaption( ).setValue( "Meter
> Chart TEST" );//$NON-NLS-1$
> dChart.getTitle( ).getOutline( ).setVisible( false );
>
> // Legend
> final Legend lg = dChart.getLegend( );
> final LineAttributes lia = lg.getOutline( );
> lg.getText( ).getFont( ).setSize( 16 );
> lia.setStyle( LineStyle.SOLID_LITERAL );
> lg.getInsets( ).setLeft( 10 );
> lg.getInsets( ).setRight( 10 );
> lg.setBackground( null );
> lg.getOutline( ).setVisible( false );
> lg.setShowValue( false );
> lg.getClientArea( ).setBackground( ColorDefinitionImpl.PINK( ) );
>
> lg.getClientArea( ).getOutline( ).setVisible( true );
> lg.getTitle( ).getCaption( ).getFont( ).setSize( 20 );
> lg.getTitle( ).setInsets( InsetsImpl.create( 10, 10, 10, 10 ) );
> lg.setTitlePosition( Position.ABOVE_LITERAL );
> lg.setItemType( LegendItemType.SERIES_LITERAL );
>
> // Data Set
> final TextDataSet categoryValues = TextDataSetImpl.create( new
> String[]{
> "Speed"} );//$NON-NLS-1$
>
> final SeriesDefinition sdBase = SeriesDefinitionImpl.create( );
> dChart.getSeriesDefinitions( ).add( sdBase );
>
> final Series seCategory = SeriesImpl.create( );
> seCategory.setDataSet( categoryValues );
> sdBase.getSeries( ).add( seCategory );
>
> final SeriesDefinition sdOrth = SeriesDefinitionImpl.create( );
>
> final Fill[] fiaOrth = {
> ColorDefinitionImpl.ORANGE( ),
> ColorDefinitionImpl.RED( ),
> ColorDefinitionImpl.GREEN( )
> };
>
> sdOrth.getSeriesPalette( ).getEntries( ).clear( );
> for (final Fill element : fiaOrth) {
> sdOrth.getSeriesPalette( ).getEntries( ).add( element );
> }
>
> // Dial 1
> final DialSeries seDial1 = (DialSeries) DialSeriesImpl.create( );
> seDial1.setDataSet( NumberDataSetImpl.create( new double[]{
> 60
> } ) );
> seDial1.getDial( )
> .setFill( GradientImpl.create(
> ColorDefinitionImpl.create( 125,
> 125,
> 255 ),
> ColorDefinitionImpl.create( 255, 255, 225 ),
> -35,
> false ) );
> seDial1.getNeedle( ).setDecorator( LineDecorator.ARROW_LITERAL );
>
> seDial1.getNeedle().setLineAttributes(LineAttributesImpl.cre ate(ColorDefinitionImpl.ORANGE(),
> LineStyle.SOLID_LITERAL, 4));
> seDial1.getDial( )
> .getMinorGrid( )
> .getTickAttributes( )
> .setVisible( false );
> final Label tickLabel = LabelImpl.create();
> final TextAlignment ta = TextAlignmentImpl.create();
> ta.setHorizontalAlignment(HorizontalAlignment.CENTER_LITERAL );
> ta.setVerticalAlignment(VerticalAlignment.CENTER_LITERAL);
>
> tickLabel.getCaption().setFont(FontDefinitionImpl.create("Arial ", 5.0f,
> false, false, false, false, false, 0, ta));
> seDial1.getDial().setLabel(tickLabel);
> seDial1.getDial().getLabel().setVisible(true);
>
>
> seDial1.getDial( )
> .getMinorGrid( )
> .getTickAttributes( )
> .setColor( ColorDefinitionImpl.RED( ) );
> seDial1.getDial( )
> .getMinorGrid( )
> .setTickStyle( TickStyle.ACROSS_LITERAL );
> seDial1.getDial( ).getScale().setMinorGridsPerUnit( 2 );
> seDial1.getDial( )
> .getScale( )
> .setMin( NumberDataElementImpl.create( 0 ) );
> seDial1.getDial( )
> .getScale( )
> .setMax( NumberDataElementImpl.create( 220 ) );
> seDial1.getDial().getScale().setStepNumber(20);
>
> //seDial1.getDial( ).getScale( ).setAutoExpand(true);
> seDial1.getLabel( )
> .setOutline( LineAttributesImpl.create(
> ColorDefinitionImpl.YELLOW( )
> .darker( ),
> LineStyle.SOLID_LITERAL,
> 1 ) );
> seDial1.getLabel( ).setBackground( ColorDefinitionImpl.GREY( )
> // .brighter( ) )
> .translucent());
> seDial1.setSeriesIdentifier( "Speed 1" );//$NON-NLS-1$
>
> dChart.setDialSuperimposition( true );
> sdBase.getSeriesDefinitions( ).add( sdOrth );
> sdOrth.getSeries( ).add( seDial1 );
>
> return dChart;
> }
Re: Alignment of labels for meter chart [message #646561 is a reply to message #643436] Mon, 27 December 2010 17:53 Go to previous message
Eclipse User
Originally posted by: anders.hessellund.gmail.com

Jason Weathersby wrote:
> Anders,
>
> this looks like a bug. If you do not mind can you log it? One thing that
> would make it look better is to use an even number of ticks. so in your
> case try:
>
> > .setMax( NumberDataElementImpl.create( 220 ) );
> > seDial1.getDial().getScale().setStepNumber(22);
>
> Jason
>
> On 12/6/2010 10:18 AM, Anders Hessellund wrote:
>> public static final Chart createMDialSRegionChart( )
>> {
>> final DialChart dChart = (DialChart) DialChartImpl.create( );
>> dChart.setDialSuperimposition( false );
>> dChart.setGridColumnCount( 2 );
>> dChart.setSeriesThickness( 25 );
>>
>> // Title/Plot
>> dChart.getBlock( ).setBackground( ColorDefinitionImpl.WHITE( ) );
>> final Plot p = dChart.getPlot( );
>> p.getClientArea( ).setBackground( null );
>> p.getClientArea( ).getOutline( ).setVisible( false );
>> p.getOutline( ).setVisible( false );
>>
>> dChart.getTitle( ).getLabel( ).getCaption( ).setValue( "Meter
>> Chart TEST" );//$NON-NLS-1$
>> dChart.getTitle( ).getOutline( ).setVisible( false );
>>
>> // Legend
>> final Legend lg = dChart.getLegend( );
>> final LineAttributes lia = lg.getOutline( );
>> lg.getText( ).getFont( ).setSize( 16 );
>> lia.setStyle( LineStyle.SOLID_LITERAL );
>> lg.getInsets( ).setLeft( 10 );
>> lg.getInsets( ).setRight( 10 );
>> lg.setBackground( null );
>> lg.getOutline( ).setVisible( false );
>> lg.setShowValue( false );
>> lg.getClientArea( ).setBackground( ColorDefinitionImpl.PINK( ) );
>>
>> lg.getClientArea( ).getOutline( ).setVisible( true );
>> lg.getTitle( ).getCaption( ).getFont( ).setSize( 20 );
>> lg.getTitle( ).setInsets( InsetsImpl.create( 10, 10, 10, 10 ) );
>> lg.setTitlePosition( Position.ABOVE_LITERAL );
>> lg.setItemType( LegendItemType.SERIES_LITERAL );
>>
>> // Data Set
>> final TextDataSet categoryValues = TextDataSetImpl.create( new
>> String[]{
>> "Speed"} );//$NON-NLS-1$
>>
>> final SeriesDefinition sdBase = SeriesDefinitionImpl.create( );
>> dChart.getSeriesDefinitions( ).add( sdBase );
>>
>> final Series seCategory = SeriesImpl.create( );
>> seCategory.setDataSet( categoryValues );
>> sdBase.getSeries( ).add( seCategory );
>>
>> final SeriesDefinition sdOrth = SeriesDefinitionImpl.create( );
>>
>> final Fill[] fiaOrth = {
>> ColorDefinitionImpl.ORANGE( ),
>> ColorDefinitionImpl.RED( ),
>> ColorDefinitionImpl.GREEN( )
>> };
>>
>> sdOrth.getSeriesPalette( ).getEntries( ).clear( );
>> for (final Fill element : fiaOrth) {
>> sdOrth.getSeriesPalette( ).getEntries( ).add( element );
>> }
>>
>> // Dial 1
>> final DialSeries seDial1 = (DialSeries) DialSeriesImpl.create( );
>> seDial1.setDataSet( NumberDataSetImpl.create( new double[]{
>> 60
>> } ) );
>> seDial1.getDial( )
>> .setFill( GradientImpl.create(
>> ColorDefinitionImpl.create( 125,
>> 125,
>> 255 ),
>> ColorDefinitionImpl.create( 255, 255, 225 ),
>> -35,
>> false ) );
>> seDial1.getNeedle( ).setDecorator( LineDecorator.ARROW_LITERAL );
>>
>> seDial1.getNeedle().setLineAttributes(LineAttributesImpl.cre ate(ColorDefinitionImpl.ORANGE(),
>>
>> LineStyle.SOLID_LITERAL, 4));
>> seDial1.getDial( )
>> .getMinorGrid( )
>> .getTickAttributes( )
>> .setVisible( false );
>> final Label tickLabel = LabelImpl.create();
>> final TextAlignment ta = TextAlignmentImpl.create();
>> ta.setHorizontalAlignment(HorizontalAlignment.CENTER_LITERAL );
>> ta.setVerticalAlignment(VerticalAlignment.CENTER_LITERAL);
>>
>> tickLabel.getCaption().setFont(FontDefinitionImpl.create("Arial ", 5.0f,
>> false, false, false, false, false, 0, ta));
>> seDial1.getDial().setLabel(tickLabel);
>> seDial1.getDial().getLabel().setVisible(true);
>>
>>
>> seDial1.getDial( )
>> .getMinorGrid( )
>> .getTickAttributes( )
>> .setColor( ColorDefinitionImpl.RED( ) );
>> seDial1.getDial( )
>> .getMinorGrid( )
>> .setTickStyle( TickStyle.ACROSS_LITERAL );
>> seDial1.getDial( ).getScale().setMinorGridsPerUnit( 2 );
>> seDial1.getDial( )
>> .getScale( )
>> .setMin( NumberDataElementImpl.create( 0 ) );
>> seDial1.getDial( )
>> .getScale( )
>> .setMax( NumberDataElementImpl.create( 220 ) );
>> seDial1.getDial().getScale().setStepNumber(20);
>>
>> //seDial1.getDial( ).getScale( ).setAutoExpand(true);
>> seDial1.getLabel( )
>> .setOutline( LineAttributesImpl.create(
>> ColorDefinitionImpl.YELLOW( )
>> .darker( ),
>> LineStyle.SOLID_LITERAL,
>> 1 ) );
>> seDial1.getLabel( ).setBackground( ColorDefinitionImpl.GREY( )
>> // .brighter( ) )
>> .translucent());
>> seDial1.setSeriesIdentifier( "Speed 1" );//$NON-NLS-1$
>>
>> dChart.setDialSuperimposition( true );
>> sdBase.getSeriesDefinitions( ).add( sdOrth );
>> sdOrth.getSeries( ).add( seDial1 );
>>
>> return dChart;
>> }
>
Thanks, I'll file a bug report.
Previous Topic:Iportal problem
Next Topic:User Defined Sort On Grouped Data
Goto Forum:
  


Current Time: Sat Aug 23 11:34:15 EDT 2014

Powered by FUDForum. Page generated in 0.13432 seconds