0
votes

Hey. I am currently developing a .NET application using Visual Studio 2008 and Crystal Reports 12 (2008 Full).

I am binding a custom object that looks like similar to this:

class CustomDataClass
{
   public double Field1;
   public double Field2;
   public double Field3;
   public double Field4;
   public double Field5;
}

Each field will represent it's own line. So in this case there will be 5 lines displayed.

The chart displays the data correctly using the above class however I want to color each series in a specific color. For example Field1 data should be blue. Field2 data should red.

I tried using the Color Highlight tab to achieve this but it did not work. I set it up in the following way:

Value of Field1 between -9999 and 9999 then apply a blue color. I then applied the same rule for the remaining fields.

This did not work well though. The lines were not colored as expected.

Did I set up the chart correctly? Any help would be appreciated.

3
Crystals reports sucks. A lot. - Brownman98

3 Answers

0
votes

As far as I could find there isn't a way to apply custom colors to a line chart conditionally although this worked with bar charts.

The chart will always apply the same colors to each series in the chart in the same order so I used that to create a custom legend. It's a dirty hack but it worked.

0
votes

You could generate your chart outside of crystal and the pass it as an image to be displayed in the report.

0
votes

You can use CRChart library which allow you to customize chart using macros. (It's not free, sorry) It solves problem with different line colors for sure.