Hi,
Is there a way to dynamically set the chart height based on the number of data rows? The chart looks fine when there are about 10-12 rows of data, but anything more and it starts to squish to meet the height requirements of the chart. I'm assuming there is a way and I'm just missing it!
I'm using the standalone Telerik Report Designer FYI. I've attached photos for an example.
4 Answers, 1 is accepted
Hello Phil,
The height of the Graph can be controlled through a Binding. The attached report demonstrates the following approach:
1) Create a Bar chart whose values come from a CSV DataSource. Note that the graph is located in the Report Header because its data source is bound to the report data source.
2) Click on the graph -> select Binding from the menu with properties.
3) Set the following binding:
Property path: Height
Expression: =IIF(Count(Fields.X)>4, "5in", "3.1in")
You may increase the number of records in the data source to test.
Regards,
Neli
Progress Telerik
Hi Neli,
Thanks for getting back to me. I tried your solution however it doesn't seem to work. I'm using an Object DataSource, that returns a dictionary, hence the Fields.Key selection. I don't have my chart in the Report Header, and my DataSource is bound to the chart, not the report. Should it be?
Is there anything else I am missing?
Thanks,
Phil
Hi Neli,
Just wondering if you have any further tips that could help me in this situation?
Thanks
Hi Phil,
Basically, the Binding of the Graph or other data item takes the data fields from the data context of the parent object. In this case, this is the Detail section, which data context is the Report DataSource. For that reason, you can access the fields only if they are bound to the report. Another option which you can try is to put the graph in a List item whose data source is the Object DataSource. Then you may bind the Graph DataSource to its parent DataSource - check Binding to data from the parent data item.
Please, test and let us know whether this has helped.
Regards,
Neli
Progress Telerik