Пример #1
0
        public void UpdateGraph(Customer customer)
        {
            var graphTitle = customer.FirstName + " Investment History";
            //TODO fix labels
            var xAxisTitle = "Investment #";
            var yAxisTitle = "# Shares of Stock";

            //TODO update how data is passed and retrieved to graph (need to be able to include value + label for each bar in dataset)
            //TODO get graph size from parent container size?


            // If graph already exists update values. Else create new graph.
            if (mainContainer.Children.Count > 0 && currentGraph != null)
            {
                currentGraph.UpdateGraphData(graphTitle, xAxisTitle, yAxisTitle, customer.Data);
            }
            else
            {
                BarGraph graph = new BarGraph(c, hwndHost, graphTitle, xAxisTitle, yAxisTitle,
                                              hostWidth, hostHeight, customer.Data,
                                              true, BarGraph.GraphOrientation.Vertical,
                                              BarGraph.GraphBarStyle.AmbientAnimatingPerBarLinearGradient,
                                              new List <Color> {
                    Colors.Black, Colors.DarkRed, Colors.DarkOrange, Colors.Yellow
                });

                currentGraph = graph;
                mainContainer.Children.InsertAtTop(graph.GraphRoot);
            }
        }
Пример #2
0
        // Handle Composition tree creation and updates.
        public void UpdateGraph()
        {
            Customer customer = DataContext as Customer;

            if (customer != null)
            {
                var graphTitle = customer.FirstName + " Investment History";
                var xAxisTitle = "Investment #";
                var yAxisTitle = "# Shares of Stock";

                // If graph already exists update values. Otherwise, create new graph.
                if (graphContainer.Children.Count > 0 && currentGraph != null)
                {
                    currentGraph.UpdateGraphData(graphTitle, xAxisTitle, yAxisTitle, customer.Data);
                }
                else
                {
                    var graph = new BarGraph(compositor, compositionHost.hwndHost, graphTitle, xAxisTitle, yAxisTitle,
                                             (float)CompositionHostElement.ActualWidth, (float)CompositionHostElement.ActualHeight, currentDpiX, currentDpiY, customer.Data, windowRenderTarget,
                                             true, BarGraph.GraphBarStyle.PerBarLinearGradient,
                                             new List <Windows.UI.Color> {
                        Windows.UI.Color.FromArgb(255, 246, 65, 108), Windows.UI.Color.FromArgb(255, 255, 246, 183)
                    });

                    currentGraph = graph;
                    graphContainer.Children.InsertAtTop(graph.GraphRoot);
                }
            }
        }
Пример #3
0
        // Handle Composition tree creation and updates.
        public void UpdateGraph()
        {
            Customer customer = DataContext as Customer;

            if (customer != null)
            {
                var graphTitle = customer.FirstName + " Investment History";

                // If graph already exists update values. Otherwise, create new graph.
                if (_graphContainer.Children.Count > 0 && _currentGraph != null)
                {
                    _currentGraph.UpdateGraphData(graphTitle, c_xAxisTitle, c_yAxisTitle, customer.Data);
                }
            }
        }
Пример #4
0
        /*
         * Handle Composition tree creation and updates
         */
        public void UpdateGraph(Customer customer)
        {
            var graphTitle = customer.FirstName + " Investment History";
            var xAxisTitle = "Investment #";
            var yAxisTitle = "# Shares of Stock";

            // If graph already exists update values. Else create new graph.
            if (mainContainer.Children.Count > 0 && currentGraph != null)
            {
                currentGraph.UpdateGraphData(graphTitle, xAxisTitle, yAxisTitle, customer.Data);
            }
            else
            {
                BarGraph graph = new BarGraph(c, hwndHost, graphTitle, xAxisTitle, yAxisTitle,
                                              hostWidth, hostHeight, hostDPI, customer.Data,
                                              true, BarGraph.GraphBarStyle.AmbientAnimatingPerBarLinearGradient,
                                              new List <Color> {
                    Colors.DarkBlue, Colors.BlueViolet, Colors.LightSkyBlue, Colors.White
                });

                currentGraph = graph;
                mainContainer.Children.InsertAtTop(graph.GraphRoot);
            }
        }
        // Handle Composition tree creation and updates.
        public void UpdateGraph(Customer customer)
        {
            var graphTitle = customer.FirstName + " Investment History";
            var xAxisTitle = "Investment #";
            var yAxisTitle = "# Shares of Stock";

            // If graph already exists update values. Else create new graph.
            if (containerVisual.Children.Count > 0 && currentGraph != null)
            {
                currentGraph.UpdateGraphData(graphTitle, xAxisTitle, yAxisTitle, customer.Data);
            }
            else
            {
                BarGraph graph = new BarGraph(compositor, hwnd, graphTitle, xAxisTitle, yAxisTitle,
                                              (float)Width, (float)Height, currentDpiX, currentDpiY, customer.Data, //TODO update DPI variable
                                              true, BarGraph.GraphBarStyle.PerBarLinearGradient,
                                              new List <Windows.UI.Color> {
                    Windows.UI.Color.FromArgb(255, 246, 65, 108), Windows.UI.Color.FromArgb(255, 255, 246, 183)
                });

                containerVisual.Children.InsertAtTop(graph.GraphRoot);
                currentGraph = graph;
            }
        }