locked
how can i start my winrt xaml column chart from 0 axis in middle if there is values in (- )mins/negetive or from bottom if values in positive

    Question

  • how can i start my winrt xaml column chart from 0 axis in middle if there is values in (- )mins/negetive or from bottom if values in positive

    i am using this code to fix bar width and color of each bar

    private static Style GetNewDataPointStyle2(int it)
            {
    
               
                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 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;
            }
    

    current output is.....

    but i need

    or.. starting 0 from bottom if all values are positive

    Thursday, March 6, 2014 6:47 AM

Answers

All replies

  • You don't say what control you are using. There is no control which does what you show in-box. You probably need to talk to the authors of that control for help on how to use it.

    --Rob

    Thursday, March 6, 2014 6:57 AM
    Owner
  • i am using winrt xaml toolkit
    Thursday, March 6, 2014 7:11 AM
  • I don't know if any community members are familiar with that control, but you can find discussions and documentation on the WinRT Xaml Toolkit at http://winrtxamltoolkit.codeplex.com/ .

    Thursday, March 6, 2014 6:55 PM
    Owner
  • Thanks Rob, I'll take over at https://winrtxamltoolkit.codeplex.com/discussions/538141

    Note that WinRT XAML Toolkit is not a Microsoft product, though the Chart control itself is a version of the Chart control from Silverlight Toolkit (made by Microsoft) and ported to WinRT platform.


    Filip Skakun

    Thursday, March 6, 2014 10:17 PM