Item dimensions not applied when Zoom enabled

Thread is closed for posting
4 posts, 1 answers
  1. Quantesys IT
    Quantesys IT avatar
    21 posts
    Member since:
    Feb 2009

    Posted 29 Oct 2009 Link to this post

    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
  2. Quantesys IT
    Quantesys IT avatar
    21 posts
    Member since:
    Feb 2009

    Posted 02 Nov 2009 Link to this post

    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; 


  3. Answer
    Giuseppe
    Admin
    Giuseppe avatar
    2363 posts

    Posted 03 Nov 2009 Link to this post

    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.
  4. Quantesys IT
    Quantesys IT avatar
    21 posts
    Member since:
    Feb 2009

    Posted 10 Nov 2009 Link to this post

    Thank you for your help, it works perfectly!

    Joël
Back to Top