Quantcast
Channel: WinRT XAML Toolkit
Viewing all articles
Browse latest Browse all 1067

New Post: Can't use AreaChartWithNoLabels

$
0
0
I'm going to use AreaChartWithNoLabels in my app, but I couldn't get anything after some coding.
 public sealed partial class fpref : Page
    {
        public fpref()
        {
            this.InitializeComponent();
            var items1 = new List<NameValueItem>();
            var items2 = new List<NameValueItem>();
            var items3 = new List<NameValueItem>();
            items1.Add(new NameValueItem { Name = "Test" , Value = 50 });
            items1.Add(new NameValueItem { Name = "Test", Value = 50 });
            items1.Add(new NameValueItem { Name = "Test", Value = 50 });
            items1.Add(new NameValueItem { Name = "Test", Value = 50 });
            items1.Add(new NameValueItem { Name = "Test", Value = 50 });
            items2.Add(new NameValueItem { Name = "Test" , Value = 20 });
            items3.Add(new NameValueItem { Name = "Test" , Value = 85 });

            var series = (AreaSeries)this.AreaChartWithNoLabels.Series[0];
            series.ItemsSource = items1;


            series.DependentRangeAxis =
                new LinearAxis
                {
                    Minimum = 0,
                    Maximum = 100,
                    Orientation = AxisOrientation.Y,
                    Interval = 20,
                    ShowGridLines = false,
                    Width = 0
                };
            series.IndependentAxis =
                new CategoryAxis
                {
                    Orientation = AxisOrientation.X,
                    Height = 0
                };

        }
                

        }
        



    }
    public class NameValueItem
    {
        public string Name { get; set; }
        public int Value { get; set; }
    }
and XAML:
<charting:Chart
                x:Name="AreaChartWithNoLabels"
                Margin="70,0">
            <charting:Chart.LegendStyle>
                <Style
                        TargetType="datavis:Legend">
                    <Setter
                            Property="Width"
                            Value="0"/>
                </Style>
            </charting:Chart.LegendStyle>
            <charting:AreaSeries
                    Title="Population"
                    IndependentValueBinding="{Binding Name}"
                    DependentValueBinding="{Binding Value}"
                    IsSelectionEnabled="True">
                <charting:AreaSeries.DataPointStyle>
                    <Style
                            TargetType="charting:AreaDataPoint">
                        <Setter
                                Property="BorderThickness"
                                Value="0" />
                        <Setter
                                Property="IsTabStop"
                                Value="False" />
                        <Setter
                                Property="Width"
                                Value="0" />
                        <Setter
                                Property="Height"
                                Value="0" />
                        <Setter
                                Property="Template">
                            <Setter.Value>
                                <ControlTemplate
                                        TargetType="charting:AreaDataPoint">
                                    <Grid
                                            x:Name="Root"
                                            Opacity="0" />
                                </ControlTemplate>
                            </Setter.Value>
                        </Setter>
                    </Style>
                </charting:AreaSeries.DataPointStyle>
            </charting:AreaSeries>
        </charting:Chart>
anyone can help me ?

Viewing all articles
Browse latest Browse all 1067

Latest Images

Trending Articles





Latest Images