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!

Re-size Pie Charts dynamically

Status
Not open for further replies.

partymong

Programmer
Nov 5, 2003
39
0
0
GB
Hi All,
I am fairly new to reporting services.

I want to create a report, whereby there are 9 pie charts which would need to dynamically vary in size dependant on the number of records returned for each pie chart data. (i.e. the pie charts size would need to be proportionate to the total number records for all pie chart data)

Is there a way I can re-size the charts dynamically?

Would I have to generate the rdl file with the pie charts size each time I would like to generate a report.

Thankyou in advance for your help.

Regards,

P
 
Are you wanting to resize the chart object itself or the size of the pie within the chart ?

Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
Geoff,
I want to resize the entire chart objects.
Example:

Say I have some data with a "priority" field and a Status "Field"

Say each of the 9 pie charts show status data for a particular priority.

I want to change the size of each pie chart to show the amount (or impact) that priority has on the total of all the priority data.


Is this possible?

Thanks,

Regards,

P
 
the sizing (as well as many other properties in RS) can be set as the result of code or an expression. You will need to decide how the priority affects the size of the charts but as an example, you could have the width of the chart set to

=Fields!Priority.Value * Fields!Priority.Value

This would give you the square of the priority for the width of the chart. I'm pretty sure you don't want to do that so you would need to come up with sonme kind of algorithm that equates the priority to the chart size but in principle, once you have that, it is as simple as

ChartWidth property =

=Fields!Priority.Value * WidthMultiplier

ChartHeight property =

=Fields!Priority.Value * HeightMultiplier

Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
Thanks Geoff,
That is just what I need to do.
However I can't seem to use an expression or code for the width or height in the Report Designer properties window for the chart. (property value is not valid error ...cannot be parsed because it does not contain numeric values)

I can manipulate other properties using code and expressions but not the charts size properties...

Perhaps I may have misunderstood you..

Thanks for your help

P
 
I do apologise. I thought that you could manipulate those properties with expresasions but it appears not (RS2000) :-(


Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
No problem..Geoff

Can't do it in RS2005 either :-(

Is there any other way I could 'hack' it?

Do you know if this will be available in RS2008?

Thanks for your help

P
 
Only way I could think of would be to hack the RDL file itself (not done it myself but have heard that it is possible). Seems like you can't dynamically alter the height / width properties of anything (was thinking you could have dynamically sized subreports but nope)

You may also be able to write an assembly to do this but again, I have not done it myself and I am not proficient enough in .NET to properly explain how to do so.

Other than that, maybe an ASP.NET app with dynamic frame sizes....one for each chart....maybe a bit overkill though ;-)



Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top