Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CR-10-Pie chart - Problem showing the Negative value

Status
Not open for further replies.

hariomhari

Programmer
Aug 13, 2007
31
GB


SELECT Strategy,(SUM(Exposure)) as Exposure FROM table WHERE PortfolioID = 1 GROUP BY Strategy

The output is:
-----------------------------------------
Strategy Exposure
------------------------------------------
1101924.90178831
Cash & Equivalent -39644.3596947789

I am displaying the Exposure data for different strategy in pir chart. But problem is no data is displayed in case Exposure is negative. If exposure is positive value then it displayes value fine.

If I use the SQL view as datasource for crystal report instead of xsd file AND change the (SUM(Exposure)) to ABS((SUM(Exposure)) ) then data is displayed in the pie chart.

However, with XSD datasource and ABS((SUM(Exposure))) , pie chart is not showing data in case exposure is negative value. In case of negative value pie chart displays data in braket : Cash & equivalent (3.5)%
 
If you expect to display a negative value, a pie chart is not the way to go. If you think about it, how could negative space be represented?

-LB
 
But the negative value is displayed in the same manner as positive in the pie chart if the datasource is SQL view instead of XSD file.

The legend contains bracket around the negative value..

further, can you please suggest other type of chart in this scneario.
 
I would assume you would need to convert any negative value to a positive value for the sake of representation.

One suggestion would be for example:

Value 1: Blue
Value 2: Red

Conditionally format the sections so that if Value 2 is negative prior to conversion then it colors the slice purple instead of red. This can be used to then mimic a transparent slice to gauge the negative value.

I'm sure there is a way to dynamically bracket off the value where a negative - but then you will need to ensure that whilst the value itself is converted to a positive value for the sake of representation, the data label and formatting is based on the original value prior to conversion.

Phew, I hope that makes more sense than it sounds immediately after writing.

I support LBass in the fact that a pie chart is not the most effective way to represent this data.

'J
 
1. If I use ABS((SUM(Exposure)) ) then data is displayed in the pie chart. But this is when i use SQL view as datasource.

2. If I try to do the same using the xsd datasource nothing is displayed.

3. Conditionally format the sections : As far as I know the colors are displayed by CR automatically. Do I have control over the legend colors..Can I assign the different colors for ex when I am displaying the total investment in a Portfolio group by Strategy..
 
Yes you can assign the colours, although without you posting information such as Crystal version it is difficult to guide you.

Different versions give different additional features in particular in the areas of charting.

'J
 
The subject of this thread contains the CR version. I am using CR version 10.

I would like to have the detailed information about this color
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top