Как привязать график линии wpf к данным? - PullRequest
0 голосов
/ 29 апреля 2011

вот код xaml:

<graphs:Chart x:Name="Chart2" Margin="0,236,412,12" HorizontalAlignment="Right" Width="417" BorderBrush="Black" DataContext="{Binding}" Grid.ColumnSpan="5">
            <graphs:LineSeries ItemsSource="{Binding}"
                DependentValuePath="PAPER"
                IndependentValuePath="DATES"
                Title="Paper" IsSelectionEnabled="True" />
            <graphs:LineSeries ItemsSource="{Binding}"
                DependentValuePath="PLASTIC"
                IndependentValuePath="DATES"
                Title="Plastic" IsSelectionEnabled="True" />
            <graphs:LineSeries ItemsSource="{Binding}"
                DependentValuePath="GLASS"
                IndependentValuePath="DATES"
                Title="Glass" IsSelectionEnabled="True" />
            <graphs:LineSeries ItemsSource="{Binding}"
                DependentValuePath="METALS"
                IndependentValuePath="DATES"
                Title="Metals" IsSelectionEnabled="True" />
            <graphs:LineSeries ItemsSource="{Binding}"
                DependentValuePath="FABRIC"
                IndependentValuePath="DATES"
                Title="Fabric" IsSelectionEnabled="True" />
            <graphs:Chart.Axes>
                <graphs:LinearAxis
                                Orientation="Y"
                                Minimum="0"
                                Maximum="1000"
                                ShowGridLines="True"/>
                <graphs:CategoryAxis
                                Orientation="X"
                                ShowGridLines="True"
                                />
            </graphs:Chart.Axes>
        </graphs:Chart>

код c #:

Chart2.DataContext = ad;

таблица данных заполнена из запроса sql, и она отображается нормально, когда я связываюсьэто в виде сетки, но когда я пытаюсь привязать его к графику, ничего не появляется ...

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...