Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 210132

Summary: Difference chart legend should display P and N
Product: z_Archived Reporter: Krishna Venkatraman <kvenkatraman>
Component: BIRTAssignee: Yi Wang <yi.wang>
Status: VERIFIED WONTFIX QA Contact: Maggie Shen <lshen>
Severity: enhancement    
Priority: P3 CC: Lionel.wyl
Version: 2.2.2Keywords: plan
Target Milestone: 2.5.0   
Hardware: PC   
OS: Windows XP   
Whiteboard: Obsolete
Attachments:
Description Flags
Report design
none
Screen shot of color by value series none

Description Krishna Venkatraman CLA 2007-11-16 14:16:57 EST
Created attachment 83101 [details]
Report design

In the attached report design, there is a difference chart. In this difference chart I would like to display in the legend the fact that the positive value is for y2004 and the negative value is for y2003. There does not seem a way to do this.
Comment 1 Krishna Venkatraman CLA 2007-11-16 14:17:20 EST
Changing to enhancement
Comment 2 David Michonneau CLA 2007-11-19 09:51:45 EST
This enhancement actually applies to the multi-fill color, which can be also 
used in bar, stock, bubble charts, etc...
Comment 3 Yi Wang CLA 2008-04-11 04:45:39 EDT
I'm not very clear with the description.  If I've understood it correctly, you 
meant, that you want to display the text like "P: Y2004, N: Y2003" in the 
legend.
Since it's not a common requirement, I suggest using script to implement this 
function. For example:

function beforeDrawLegendItem( lerh, bounds, icsc )
{
	lerh.getLabel().getCaption().setValue("P: Y2004, N: Y2003");
}

Is that what you meant?
Comment 4 Yulin Wang CLA 2008-04-24 03:01:57 EDT
Postponed due to no response.
Comment 5 Krishna Venkatraman CLA 2008-04-24 11:28:43 EDT
This is a general requirement since it applies to the multi-fill color, which can be also used in bar, stock, bubble charts, etc...

I am attaching a screenshot of the chart if I color by value series. Notice that it displays P: followed by a number. I want to display P: Y2003 and N: Y2004. These are the 2 value series in the chart specified in the Select Data tab.

Comment 6 Krishna Venkatraman CLA 2008-04-24 11:29:37 EDT
Created attachment 97478 [details]
Screen shot of color by value series
Comment 7 Yulin Wang CLA 2008-05-05 05:42:13 EDT
Sorry, I can't understand why this enhancement has something to do with multi-fill color. 
Currently the data of legend entry is always the first data of the value series. The data "2003" you mentioned in select data tab is from table header, right? This is the meta-data of data set. It can't be retrieved in current data feed framework, except that you set it hardcoded in script.
The data format of legend entry is not good enough, since it can't be formatted by users and always from a data point's toString.
I think the feasible enhancement for legend entry is to format it using the data point's format specifier. That is to say, legend entry will display the same data format with the data point's. User could set the data point's format to affect legend's entry. There you could add prefix, suffix, separator and format for the entry. How do you think?
Comment 8 Yi Wang CLA 2009-03-23 04:44:37 EDT
As mentioned, this is not a common requirement. Because 'Y2003' and 'Y2004' are the name of column bindings, and the data definitions of series are expressions like 'row["Y2003"]', and there is not a one-to-one mapping from data definitions to column bindings. It's just a coincidence that the positive value of the different series is the column binding "Y2003", but it can acutally be any expressions, (e.g. 2 * row["Y2003"] -  row["Y2004"]). 
So there is no reasonable solution for this requirement, maybe you can try with script.  
Comment 9 Maggie Shen CLA 2009-04-08 22:27:51 EDT
verified.