This is a migrated thread and some comments may be shown as answers.

Problem in Telerik Reporting Chart Height

5 Answers 107 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
ciskomisko
Top achievements
Rank 1
ciskomisko asked on 19 Aug 2008, 01:01 PM
Hi,
I am using Reporting Service Q1-2008. In Telerik Report we are using a Chart Control.
How can we Increase a Height at Run Time From Code. when we Bind a Data Into The Chart.

we are using
1.

chrtServices.PlotArea.Appearance.Dimensions.SetDimensions(Telerik.Reporting.Charting.Styles.Unit.Pixel(500), Telerik.Reporting.Charting.Styles.Unit.Pixel(3000))

2. 

chrtServices.PlotArea.Appearance.Dimensions.Height = Telerik.Reporting.Charting.Styles.Unit.Pixel(Convert.ToInt32(Request.QueryString("Height")) + 1000)

But no one is working. My application is that as per my data .I have to set a Height of Chart.
Please reply me.

5 Answers, 1 is accepted

Sort by
0
Chavdar
Telerik team
answered on 20 Aug 2008, 08:18 AM
Hi ciskomisko,

You can modify the Chart's definition in the ItemDataBinding or the NeedDataSource event of the item to achieve the desired effect. For example to change chart's height you can use the following event handler as an example:

    private void chart1_NeedDataSource(object sender, System.EventArgs e)
    {
        Telerik.Reporting.Processing.Chart chart =
            (Telerik.Reporting.Processing.Chart)sender;
        Telerik.Reporting.Chart chartDefinition = (Telerik.Reporting.Chart)chart.ItemDefinition;
        chartDefinition.Height = ...
    }


Hope this helps.

All the best,
Chavdar
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
ciskomisko
Top achievements
Rank 1
answered on 27 Aug 2008, 06:58 AM
Hi, Chavdar

Thanks For your Reply.
here problem is that Chart1_NeedDataSource. or ItemDataBinding is not fired in chart object.
can you tell me how it is fired?. and once again my databind is at manually. like adding a series and add a data. i am not using any datasource method of Chart1. so, how can we fired this event?

is there are any other way to set a height of chart.?




0
Steve
Telerik team
answered on 27 Aug 2008, 07:54 AM
Hi ciskomisko,

How did you hooked the event handlers? Do you have them attached in the Events section in the property grid? How do you debug to make sure they're not fired - note that you cannot debug the designer and therefore any breakpoints you set would not be hit when previewing the report.

Sincerely yours,
Steve
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Khurram Ilyas
Top achievements
Rank 1
answered on 02 Nov 2010, 11:45 AM
the event is fired but the height is not set.
0
Steve
Telerik team
answered on 02 Nov 2010, 12:42 PM
Hello Khurram Ilyas,

This forum thread is pretty old and the behavior of the chart has been changed. When you're in the context of events, you should set the size to the processing counterpart e.g.:

private void chart1_NeedDataSource(object sender, EventArgs e)
        {
            Telerik.Reporting.Processing.Chart chart = (Telerik.Reporting.Processing.Chart)sender;
            chart.Height = new Telerik.Reporting.Drawing.Unit(10, UnitType.Cm);
        }

Kind regards,
Steve
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
General Discussions
Asked by
ciskomisko
Top achievements
Rank 1
Answers by
Chavdar
Telerik team
ciskomisko
Top achievements
Rank 1
Steve
Telerik team
Khurram Ilyas
Top achievements
Rank 1
Share this question
or