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

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

4 Answers 156 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Woramin
Top achievements
Rank 1
Woramin asked on 23 Nov 2011, 04:38 AM
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

4 Answers, 1 is accepted

Sort by
0
Ves
Telerik team
answered on 25 Nov 2011, 03:50 PM
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 >>

0
Woramin
Top achievements
Rank 1
answered on 26 Nov 2011, 01:41 AM
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.
0
Ganesh Shivshankar
Top achievements
Rank 1
answered on 06 Jan 2012, 05:53 AM
Hi Woramin,

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

Thanks.
0
Woramin
Top achievements
Rank 1
answered on 23 Jan 2012, 09:01 AM
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>


Tags
Chart
Asked by
Woramin
Top achievements
Rank 1
Answers by
Ves
Telerik team
Woramin
Top achievements
Rank 1
Ganesh Shivshankar
Top achievements
Rank 1
Share this question
or