Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » Hide ever 2nd marker in chart
Hide ever 2nd marker in chart [message #518122] Wed, 03 March 2010 02:48 Go to next message
Eclipse UserFriend
Originally posted by: no.no.no

Hi,

i wonder if there is a way to hide some marker in a chart.
When i got a dataset with 50 rows and i am showing them all in a
single chart, i would get 50 marker. Is there a way to set a
interval or a maximum number?

Cheers,
Dennis
Re: Hide ever 2nd marker in chart [message #518162 is a reply to message #518122] Wed, 03 March 2010 10:27 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: no.no.no

Dennis Schladebeck wrote:
> Hi,
>
> i wonder if there is a way to hide some marker in a chart.
> When i got a dataset with 50 rows and i am showing them all in a
> single chart, i would get 50 marker. Is there a way to set a
> interval or a maximum number?
>
> Cheers,
> Dennis

Hi,

i found a solution

function beforeDrawMarker( marker, dph, icsc )
{
if (dph.getIndex() % 10 == 0) {
marker.setVisible(true);
} else {
marker.setVisible(false);
}
}

The only thing is, markers in the legend/caption become invisible, too.
But i guess there is a way to find out if its a marker in the caption or not.

Dennis
Re: Hide ever 2nd marker in chart [message #518327 is a reply to message #518162] Wed, 03 March 2010 14:52 Go to previous message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Dennis,

this is because your script gets called everytime a marker is generated
in the series and the legend try this:

arr = false
function beforeDrawMarker( marker, dph, icsc )
{
if (dph.getIndex() % 10 == 0) {
marker.setVisible(true);
} else {
if( !arr ){
marker.setVisible(false);
}else{
marker.setVisible(true);
}
}
}

function beforeDrawLegendItem( lerh, bounds, icsc )
{
arr = true;
}

Jason

Dennis Schladebeck wrote:
> Dennis Schladebeck wrote:
>> Hi,
>>
>> i wonder if there is a way to hide some marker in a chart.
>> When i got a dataset with 50 rows and i am showing them all in a
>> single chart, i would get 50 marker. Is there a way to set a
>> interval or a maximum number?
>>
>> Cheers,
>> Dennis
>
> Hi,
>
> i found a solution
>
> function beforeDrawMarker( marker, dph, icsc )
> {
> if (dph.getIndex() % 10 == 0) {
> marker.setVisible(true);
> } else {
> marker.setVisible(false);
> }
> }
>
> The only thing is, markers in the legend/caption become invisible, too.
> But i guess there is a way to find out if its a marker in the caption or
> not.
>
> Dennis
Previous Topic:java.lang.NullPointerException, at org.eclipse.birt.chart.factory.Generator.getRowExpressions
Next Topic:Expand Collapse Row Script
Goto Forum:
  


Current Time: Sat Apr 27 02:30:58 GMT 2024

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

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

Back to the top