Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
850
Line series custom markers shifting position
posted

Hi, I have custom markers bound to a visibility checkbox. When the box is changed the position of the markers can shift dramatically. If I update the UI somehow (like zoom, scroll, etc...) it will fix itself. This only happens to my dynamically added charts via code behind. I've attached a small sample project showing the problem. I'm thinking I need a way to trigger an UpdateLayout when the visibility changes.

Thanks6232.GenerateChart.zip

Peter

Parents
  • 2155
    Verified Answer
    Offline posted

    Hello Peter,

    Thank you for posting in Infragistics forum.

    Can you please try adding HorizontalAlignment setting to the Rectangle object in your marker template and see if it fits your requirement?

    --------------------------------
            private static DataTemplate GetMarkerTemplate(string color, Presenter viewModel)
            {
                DataTemplate template = new DataTemplate();
                double heightAndWidth = 7;
                FrameworkElementFactory gridFactory = new FrameworkElementFactory(typeof(Grid));
                FrameworkElementFactory rectangleFactory = new FrameworkElementFactory(typeof(Rectangle));
                //Set HorizontalAlignment=Left.
                rectangleFactory.SetValue(Rectangle.HorizontalAlignmentProperty, HorizontalAlignment.Left);

    .....
            }
    --------------------------------

Reply Children
No Data