Format series title in stack-column charts

Stimulsoft Reports.NET discussion
Post Reply
jing
Posts: 50
Joined: Fri Jan 26, 2007 12:47 am
Location: New Zealand

Format series title in stack-column charts

Post by jing »

Hi,

I have 2 series on my stacked-column graph. I would like to format one of my series title to show more than just text.
I would like it to say "Capacity: 24GB", The capacity value I can get from a datafield.

So I put

Capacity {first(DiskDrives.Capacity)} in the title property of the series. The chart treats the whole thing as text...

How can I get around this?

thanks a lot
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

Format series title in stack-column charts

Post by Edward »

Please input the following text into Event Handler OnBeforePrint of the Chart component:

Code: Select all

DiskDrives.First;
Chart1.Series[0].Title = "Capacity: "+DiskDrives.Capacity;
Thank you.
jing
Posts: 50
Joined: Fri Jan 26, 2007 12:47 am
Location: New Zealand

Format series title in stack-column charts

Post by jing »

thanks.

I have 3 series, each showing the usage of each disk drive. The chart is in a databand listing all disk drives. There are 3 of them (C:, D: and E:), the problem now is that the capacity title is correct for drive C: and E:, but incorrect for D:. D drive's capcity is the same as C drive, yet all 3 charts are correct....what's going on here?

thanks

Vital
Posts: 1278
Joined: Fri Jun 09, 2006 4:04 am

Format series title in stack-column charts

Post by Vital »

In this case use following code:

Code: Select all


DiskDrives.First;
int index = 0;

while (!DiskDrivers.IsEof)
{
    Chart1.Series[index++].Title = "Capacity: "+DiskDrives.Capacity;
    DiskDrivers.Next();
}
Thank you.
Post Reply