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

[Solved] Item dimensions not applied when Zoom enabled

3 Answers 94 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Quantesys IT
Top achievements
Rank 1
Quantesys IT asked on 29 Oct 2009, 08:36 AM
Hello,

I have a Serie with personalized images instead of the default item image. I don't have problem to display my images (with zoom enabled or disabled).

I define the size of my images in the BeforeLayout event as following:

protected void rcChart_BeforeLayout(object sender, EventArgs e)  
    {  
            // Configure the icons  
            foreach (ChartSeriesItem item in rcChart.Series[0].Items)  
            {  
                item.PointAppearance.Dimensions.Width = 25;  
                item.PointAppearance.Dimensions.Height = 35;  
            }  
    } 
The images are displayed correctly when the EnableZoom property is set to "false" but when this property is set to "true" the new size is not applied for my images.
I have the correct images with the default size defined automatically and the consequence is that my images are unreadable.

I used the debug mode to check if the BeforeLayout event is correctly executed and I confirm that the dimensions are correctly modified for every images.

Thank you for your help.

Joël

3 Answers, 1 is accepted

Sort by
0
Quantesys IT
Top achievements
Rank 1
answered on 02 Nov 2009, 08:22 AM
I made snapshots to illustrate my problem.

There is only one difference between these two pictures, the second picture has the Zoom enabled:
rcChart.ClientSettings.EnableZoom = true;  
rcChart.ClientSettings.ScrollMode = Telerik.Web.UI.ChartClientScrollMode.XOnly; 


0
Accepted
Giuseppe
Telerik team
answered on 03 Nov 2009, 03:53 PM
Hello Quantesys IT,

Indeed it is not possible to customize the point mark appearance in the BeforeLayout handler in this scenario. As a workaround we would suggest you to move the code to the Page_Load method like this:

ASPX:
<telerik:RadChart ID="RadChart1" runat="server" DefaultType="Line" OnBeforeLayout="RadChart1_BeforeLayout">
    <ClientSettings ScrollMode="XOnly" XScale="2" />
</telerik:RadChart>

C#:
protected void Page_Load(object sender, EventArgs e)
{
    if (!this.IsPostBack)
    {
        RadChart1.DataSource = new int[] { 1, 4, 17, 21, 5, 11, 16 };
        RadChart1.DataBind();
 
        RadChart1.Series[0].Appearance.PointMark.Visible = true;
 
        foreach (ChartSeriesItem item in RadChart1.Series[0].Items)
        {
            item.PointAppearance.FillStyle.MainColor = Color.Red;
            item.PointAppearance.FillStyle.SecondColor = Color.Red;
            item.PointAppearance.Dimensions.AutoSize = false;
            item.PointAppearance.Dimensions.Width = 25;
            item.PointAppearance.Dimensions.Height = 35;
        }
    }
}
 
protected void RadChart1_BeforeLayout(object sender, EventArgs e)
{
 
}


Hope this helps.


All the best,
Manuel
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Quantesys IT
Top achievements
Rank 1
answered on 10 Nov 2009, 07:32 AM
Thank you for your help, it works perfectly!

Joël
Tags
Chart (Obsolete)
Asked by
Quantesys IT
Top achievements
Rank 1
Answers by
Quantesys IT
Top achievements
Rank 1
Giuseppe
Telerik team
Share this question
or