how to align bars and independent axis text in winrt xaml column siries

Mar 6, 2014 at 11:44 AM
how to align bars and independent axis text in winrt xaml column siries

i am using following code for coloring and fixing width of bar
 private static Style GetNewDataPointStyle2(int it)
        {

            Random ran = new Random();
            Color background = Colors.Blue;

            //Color background = Color.FromArgb(255, (byte)ran.Next(255), (byte)ran.Next(255), (byte)ran.Next(255));
            if (it == 0)
            {
                background = Colors.SkyBlue;
            }
            if (it == 1)
            {
                background = Colors.LightGreen;
            }
            if (it == 2)
            {
                background = Colors.IndianRed;
            }
            if (it == 3)
            {
                background = Colors.Goldenrod;
            }
            if (it == 4)
            {
                background = Colors.Chocolate;
            }
            if (it == 5)
            {
                background = Colors.Aqua;
            }
            if (it == 6)
            {
                background = Colors.Brown;
            }



            Style style = new Style(typeof(Control));
            Setter st1 = new Setter(Control.BackgroundProperty, new SolidColorBrush(background));
            Setter st2 = new Setter(Control.BorderBrushProperty, new SolidColorBrush(Colors.White));
            Setter st3 = new Setter(Control.BorderThicknessProperty, new Thickness(0));
            Setter st4 = new Setter(Control.HeightProperty, 0);
            Setter st5 = new Setter(Control.WidthProperty, 0);
            Setter st6 = new Setter(Control.MaxWidthProperty, 30);
            Setter st7 = new Setter(Control.MinWidthProperty, 30);
            Setter st8 = new Setter(Control.MarginProperty, new Thickness(5, 0, 5, 0));
            Setter st9 = new Setter(Control.PaddingProperty, new Thickness(2, 2, 2, 2));
            Setter st10 = new Setter(ItemsControl.VerticalAlignmentProperty, new AlignmentX());
            //Setter st6 = new Setter(DataPoint.TemplateProperty, null); // causes exception
            style.Setters.Add(st1); style.Setters.Add(st2); style.Setters.Add(st3); style.Setters.Add(st4); style.Setters.Add(st5); style.Setters.Add(st6); style.Setters.Add(st7); style.Setters.Add(st8); style.Setters.Add(st9);
            return style;
        }
        
Coordinator
Mar 6, 2014 at 3:35 PM
Align how? Is it not aligned?
Coordinator
Mar 6, 2014 at 9:31 PM
Oh, I noticed your question at http://social.msdn.microsoft.com/Forums/silverlight/en-US/f2e9573c-cb74-4280-8b0f-649cf216979f/how-can-i-start-my-winrt-xaml-column-chart-from-0-axis-in-middle-if-there-is-values-in-?forum=winappswithcsharp

I am still not sure what exactly is it that is not working correctly for you. Can you rephrase the problem, describe it in more details, share some more pictures or a sample project?
Mar 14, 2014 at 9:39 AM
Edited Mar 14, 2014 at 9:45 AM
i am using above code to coloring and set width of each bar but bars and independent axis value are not aligned . like in this image.
Image

and i also want to start chart with 0 at y index some times it start with random value like in this image
Image
Apr 25, 2014 at 10:37 AM
is there nothing to reply?????????????????????