Layout Cycle Detected, Layout Could Not Complete After Setting Style on Bar Series

5 posts, 0 answers
  1. Woramin
    Woramin avatar
    25 posts
    Member since:
    Aug 2011

    Posted 22 Nov 2011 Link to this post

    Hi there again,

    Please help me solve this problem.


    I have created RadChart contains with custom multiple chartArea with multiple series of bar series definition in the code behind. Its purpose is to generate data of 3 months, 4 months or 7 days datasets for tracking backward activities with multiple category inside 2 chart areas. (For example if it is 3 months, there will be 3 series for bar seiries definition for each month. If it is 7 days, it will be 7 series  for each day)This Radchart has worked well with no any problem.

    The problem arise when my supervisor asked me to set color on the bar to be pure solid color without any gradient. I went on research in this forum and follow the step of setting style for bar item same as in the attached code in below link

    http://www.telerik.com/community/forums/silverlight/chart/gradient-on-bar-chart.aspx

    For data with 3 months or 4 weeks has no any problem. But when the scenario comes to 7 days. The message box arise with the text "Layout cycle detected.  Layout could not complete.". Even though the message box occured, when I pressed OK, the chart was still completedly generated. However I still wonder why the error of "Layout cycle detected" occurs

    I have tried researching again on this link http://www.telerik.com/community/forums/silverlight/chart/layout-cycle-detected-problem.aspx and try the same method by setting collection Index and setting EmptyBehavior just like the attached sample code but also doesn't work. (Note that the sample runs without any problem)


    I also attached the example pictures of RadChart that I generated, before and after settings style, that might help you understand my RadChart


    Please help me stop this error message box of "Layout cycle detected.  Layout could not complete.". If you want any additional details, you can let me know.

    Thanks
  2. Ves
    Admin
    Ves avatar
    2879 posts

    Posted 25 Nov 2011 Link to this post

    Hi Woramin,

    Our developers have recently fixed an issue with Layout Cycle Detected message being displayed. However, it is hard to tell if it is the same issue without seeing your code. Please, updated your assemblies to the latest official version -- Q3 2011, file version 2011.3.1116.1040. If the issue remains, please open a formal support ticket and send us a small example which reproduces the problem, so we can investigate it locally and get back to you with our findings.

    Best regards,
    Ves
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  3. DevCraft banner
  4. Woramin
    Woramin avatar
    25 posts
    Member since:
    Aug 2011

    Posted 25 Nov 2011 Link to this post

    Hi Ves,

    Actually after you reply, I was preparing the source code but then somehow I just coincidentally resolved the problem.

    To fix it, I just try adding the animation for the style and things work out now. I don't know whether how this is related to the layout cycle detected (since other 2 types of graph has no problem at first). But since it solved my problem. I think this case is closed

    Anyway, thanks for your reply.
  5. Ganesh Shivshankar
    Ganesh Shivshankar avatar
    78 posts
    Member since:
    Sep 2009

    Posted 05 Jan 2012 Link to this post

    Hi Woramin,

    Can you share your solution? I'm having the same issue.

    Thanks.
  6. Woramin
    Woramin avatar
    25 posts
    Member since:
    Aug 2011

    Posted 23 Jan 2012 Link to this post

    Hi Ganesh,

    Sorry that I cannot share the solution, However I already solved this problem so I can show you the way. Just set the Style like this and your problem issue should gone (I believe that I didn't set an animation in the style so it caused an error)

    <Style x:Key="CustomSolidBarStyle" TargetType="telerik:Bar">
        <Setter Property="Template" >
            <Setter.Value>
                <ControlTemplate TargetType="telerik:Bar">
                    <Canvas Opacity="0" x:Name="PART_MainContainer">
                        <Rectangle
                                x:Name="PART_DefiningGeometry"
                                Height="{TemplateBinding ItemActualHeight}"
                                Width="{TemplateBinding ItemActualWidth}"
                                Style="{TemplateBinding ItemStyle}">
                        </Rectangle>
                        <Canvas.RenderTransform>
                            <ScaleTransform
                                    x:Name="PART_AnimationTransform"
                                    ScaleY="0" />
                        </Canvas.RenderTransform>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="HoverStates">
                                <VisualState x:Name="Normal">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0.00:00:00.15" To="1.0" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="PART_MainContainer"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Hovered">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0.00:00:00.15" To="1.0" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="PART_MainContainer"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Hidden">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0.00:00:00.15" To="0.15" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="PART_MainContainer"/>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="SelectionStates">
                                <VisualState x:Name="Unselected"/>
                                <VisualState x:Name="Selected">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="0.00:00:00.05" Storyboard.TargetProperty="Stroke" Storyboard.TargetName="PART_SelectedState">
                                            <DiscreteObjectKeyFrame KeyTime="0.00:00:00.0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <SolidColorBrush Color="#B2000000"/>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0.00:00:00.05" Storyboard.TargetProperty="StrokeThickness" Storyboard.TargetName="PART_SelectedState">
                                            <DiscreteObjectKeyFrame KeyTime="0.00:00:00.0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <DiscreteObjectKeyFrame KeyTime="0.00:00:00.0" Value="2" />
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                    </Canvas>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>


Back to Top
DevCraft banner