Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » radar chart, highlighting only one radarline
radar chart, highlighting only one radarline [message #911357] Tue, 11 September 2012 12:46 Go to next message
hage Mising name is currently offline hage Mising name
Messages: 67
Registered: September 2011
Member
Hi,

i'm still working on some radarchart issues. Currently i have a chart with 5 radarlines (1-5), my primary data is in range from 0 to 3 in normal cases. in exception it is 4 or 5. Charteditor gives me the possibility to format the radar lines. is it possible to format just one of them via script? i want something like a threshold within my chart at value 3, so radarline at 3 should be in a different colour (and bold). i already tried to implement an own series for this (constant value 3), but this leds to a polygon which is not really a circle (radarline). A similar problem is, how can i get the generated polygon of a series to be rendered as a filled circle in case that all values are equal (all values of one series are 2, so the area surrounded by the radarline of 2 should be filled, which results in a coloured circle)?

any help appreciated, thx in advance,

hage
Re: radar chart, highlighting only one radarline [message #911438 is a reply to message #911357] Tue, 11 September 2012 15:49 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

Not sure this is what you want but try something like the following script:

saveser = null;
restoreLA = null;
function beforeDrawSeries( series, isr, icsc )
{
importPackage( Packages.org.eclipse.birt.chart.model.attribute.impl );
if( series.getClass() != SeriesImpl ){
saveser = series;
restoreLA = series.getLineAttributes();
}

}


function beforeDrawDataPoint( dph, fill, icsc )
{
if( dph.getOrthogonalValue() > 40 ){
saveser.getLineAttributes().setThickness(5);
saveser.getLineAttributes().setStyle(LineStyle.DASHED_LITERAL);
fill.set( 255,0,0);
saveser.getLineAttributes().setColor( ColorDefinitionImpl.RED());
}else{
saveser.setLineAttributes(restoreLA);
}
}

Jason
Re: radar chart, highlighting only one radarline [message #911442 is a reply to message #911438] Tue, 11 September 2012 15:51 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

Forgot to add the imports needed. In addition to the one that is already there add these:

importPackage( Packages.org.eclipse.birt.chart.model.type.impl );
importPackage( Packages.org.eclipse.birt.chart.model.attribute );
importPackage( Packages.org.eclipse.birt.chart.model.component.impl);
importPackage( Packages.org.eclipse.birt.chart.model.impl );

Jason
Re: radar chart, highlighting only one radarline [message #911891 is a reply to message #911442] Wed, 12 September 2012 14:25 Go to previous messageGo to next message
hage Mising name is currently offline hage Mising name
Messages: 67
Registered: September 2011
Member
thx for your reply jason, but this is not what i intend to do. your code only changes the attributes of the line representing a data-series. i want to change the attributes of a single radarline (which represent a value on the "radar" itself). see the attached image, i want to change the attributes of the (black) line, representing the 3 (and that line only, not the attributes of lines representing 1,2 or 4). Currently its covered by my "threshold"-series, but that one is represented as a polygon, not as a circle like i want it to. Hope this points out what i want to do.

any help appreciated. thx in advance,

hage

[Updated on: Wed, 12 September 2012 14:33]

Report message to a moderator

Re: radar chart, highlighting only one radarline [message #912284 is a reply to message #911891] Thu, 13 September 2012 09:07 Go to previous messageGo to next message
hage Mising name is currently offline hage Mising name
Messages: 67
Registered: September 2011
Member
viewing the report xml source, i discovered the line i need to change is called "webline", designer ui gives the possibility to change format for all of them, me need to change only one of them, or draw a circle within the chart (without generating new data entries)
Re: radar chart, highlighting only one radarline [message #912520 is a reply to message #912284] Thu, 13 September 2012 17:48 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

Currently this is not supported, but would make a great enhancement request. Can you open a bugzilla entry for this? As a work around could you add a new series that draws the line?

Jason
Re: radar chart, highlighting only one radarline [message #912806 is a reply to message #912520] Fri, 14 September 2012 08:13 Go to previous messageGo to next message
hage Mising name is currently offline hage Mising name
Messages: 67
Registered: September 2011
Member
this is what i already done, i implemented a series that contains only the constant value 3 (as much as the data series contains). works in first way, but it is not really a circle, as i do not have 360 (one for each degree at least to draw a circle-like thing) values. if i create this thresholdseries with that much values, i have an orthogonal (black) line for each value in my chart, if it is possible to turn that off for this series, it would be a work around. is it?

edit: Bugzilla Entry created

[Updated on: Fri, 14 September 2012 08:23]

Report message to a moderator

Re: radar chart, highlighting only one radarline [message #913003 is a reply to message #912806] Fri, 14 September 2012 15:20 Go to previous messageGo to next message
hage Mising name is currently offline hage Mising name
Messages: 67
Registered: September 2011
Member
i tried the following:
for(EObject eO : chart.eContents()){
        RadarSeriesImpl webSeries = null;
        if(object instanceof RadarSeriesImpl){
            RadarSeriesImpl rs = (RadarSeriesImpl)object;
            for(EObject eo1 : rs.eContents()){
                if(eo1 instanceof LineAttributesImpl){
                    for(EObject eo2 : eo1.eContents()){
                        if(eo2 instanceof ColorDefinitionImpl){
                            ColorDefinitionImpl cdi = (ColorDefinitionImpl)eo2;
                            if(cdi.getRed() == 25 && cdi.getGreen() == 223 && cdi.getBlue() == 36){
                                webSeries = rs;
                                break;
                            }
                        }
                    }
                    if(webSeries != null){
                        break;
                    }
                }
            }
            if(webSeries != null){
                log(webSeries.getDisplayName());
                log(webSeries.getLabel().getCaption().getValue());
                log(webSeries.getCatLabel().getCaption().getValue());
                log(webSeries.getWebLabel().getCaption().getValue());   
            }


}

is this the right approach? i coloured the weblines within the designer with a unique colour, so i can be sure while iterating all eObject that i found the weblines object when i get an LineAttribute child with the values from that condition. now i need to split that somehow, is that possible in any way.
(i already iterated over all children (webSeries.eAllContents) but that returns nothing that seems usefull to me)
(btw, none of the logged values are set but the display value, which always equals "Radar Series", all other values equals an emtpy string)

any help appreciated, regarding this approach or the one from above, using the 360 entries series, not displaying their orthogonal lines.

hage

[Updated on: Fri, 14 September 2012 15:22]

Report message to a moderator

Re: radar chart, highlighting only one radarline [message #913078 is a reply to message #913003] Fri, 14 September 2012 18:22 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

Where are you putting this code?

Jason
Re: radar chart, highlighting only one radarline [message #915391 is a reply to message #913078] Mon, 17 September 2012 07:38 Go to previous messageGo to next message
hage Mising name is currently offline hage Mising name
Messages: 67
Registered: September 2011
Member
currently i'm executing that within a (static) helper class in my (custom) oda driver project, passing the chart object from the afterRenderingEvent on the chart, doing that just for try&error, planning to execute that code (if it works) from within the chartscripts. does that sounds promising in any way?
Re: radar chart, highlighting only one radarline [message #915568 is a reply to message #915391] Mon, 17 September 2012 14:47 Go to previous messageGo to next message
hage Mising name is currently offline hage Mising name
Messages: 67
Registered: September 2011
Member
problem solved:
i use the polygon grid instead of the bullseye-style radarchart, the threshold series (mentioned in one of the first posts) covers exactly the webline. This is not a real solution to the problem described above, but that will do it for my purpose. (this was too obvious for me to see that easy way out, damn it Smile )

anyway, i would like to see that enhancement in one of the future releases.

thx to jason for his quick replies.

hage

[Updated on: Mon, 17 September 2012 14:49]

Report message to a moderator

Re: radar chart, highlighting only one radarline [message #915657 is a reply to message #915568] Mon, 17 September 2012 17:38 Go to previous message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

I still think this would be a good enhancement request. Glad you got a work around.

Jason
Previous Topic:Scripted Dataset
Next Topic:Problems building BIRT 3.7.1 from instructions
Goto Forum:
  


Current Time: Sat Sep 20 16:03:50 GMT 2014

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

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