示例#1
0
        private void BroadcastHubProxy_ReceiveNewMessage(object sender, BroadcastProxyEventArgs e)
        {
            // MessageBox.Show("In the chart render");;

            List <Point> dispayedPoints = new List <Point>();

            PushChart.UpdateData();

            //Draws stuff on the chart
            foreach (Tuple <int?, int?> tuple in e.data)
            {
                dispayedPoints.Add(new Point((double)(tuple.Item1 ?? 0), (double)(tuple.Item2 ?? 0)));
            }

            values = new ObservableCollection <Point>(dispayedPoints);

            PushChart.Diagram.Series[0].Points.Clear();

            foreach (Point p in values)
            {
                Bars.AddPoint(p.X, p.Y);
            }


            Bars.DataContext = this;

            Bars.Visible = true;

            //        MessageBox.Show("After the points");

            PushChart.Visibility = Visibility.Visible;

            values = null;
        }