Hide ever 2nd marker in chart [message #518122] |
Wed, 03 March 2010 02:48 |
Eclipse User |
|
|
|
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 |
Eclipse User |
|
|
|
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 |
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.03239 seconds