Home » Archived » BIRT » radar chart, highlighting only one radarline
radar chart, highlighting only one radarline [message #911357] |
Tue, 11 September 2012 12:46  |
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   |
|
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   |
|
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   |
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 #912806 is a reply to message #912520] |
Fri, 14 September 2012 08:13   |
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   |
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
|
|
| | | | |
Goto Forum:
Current Time: Mon Dec 11 23:24:38 GMT 2023
Powered by FUDForum. Page generated in 0.03029 seconds
|