Beispiel #1
0
        public void DockInsidePlotAreaNewValue()
        {
            Chart chart = new Chart();
            chart.Width = 400;
            chart.Height = 300;
            

            Legend legend = new Legend();
            legend.SetValue(FrameworkElement.NameProperty, "Legend0");
            chart.Legends.Add(legend);

            CreateAndAddDefaultDataSeries(chart);
             
            _isLoaded = false;
            chart.Loaded += new RoutedEventHandler(chart_Loaded);

            Window window = new Window();
            window.Content = chart;
            window.Show();
            if (_isLoaded)
            {
                legend.DockInsidePlotArea = true;
                Assert.IsTrue(legend.DockInsidePlotArea);
            }

            window.Dispatcher.InvokeShutdown();
            window.Close();
        }
Beispiel #2
0
        public void LightingEnabledNewValue()
        {
            Chart chart = new Chart();
            chart.Width = 400;
            chart.Height = 300;
            

            Legend legend = new Legend();
            legend.SetValue(FrameworkElement.NameProperty, "Legend0");
            legend.Background = new SolidColorBrush(Colors.Red);
            chart.Legends.Add(legend);

            CreateAndAddDefaultDataSeries(chart);
             
            _isLoaded = false;
            chart.Loaded += new RoutedEventHandler(chart_Loaded);

            Window window = new Window();
            window.Content = chart;
            window.Show();
            if (_isLoaded)
            {
                legend.LightingEnabled = true;
                Assert.IsTrue(legend.LightingEnabled);
            }

            window.Dispatcher.InvokeShutdown();
            window.Close();
        }
Beispiel #3
0
        public void ToolTipTextNewValue()
        {
            Chart chart = new Chart();
            chart.Width = 400;
            chart.Height = 300;
            

            Legend legend = new Legend();
            legend.SetValue(FrameworkElement.NameProperty, "Legend0");
            legend.Title = "Legend";
            chart.Legends.Add(legend);

            CreateAndAddDefaultDataSeries(chart, legend);

            CreateAsyncTask(chart,
                () => legend.ToolTipText = "Legend ToolTip",
                () => Assert.AreEqual("Legend ToolTip", legend.ToolTipText));

            EnqueueTestComplete();
        }
Beispiel #4
0
        public void CheckLegendProperty()
        {
            Chart chart = new Chart();
            chart.Width = 600;
            chart.Height = 300;

            _isLoaded = false;
            chart.Loaded += new RoutedEventHandler(chart_Loaded);

            Random rand = new Random();

            DataSeries dataSeries = CreateDataSeries();
            chart.Series.Add(dataSeries);

            Legend legend = new Legend();
            legend.SetValue(FrameworkElement.NameProperty, "Legend1");
            chart.Legends.Add(legend);

            dataSeries.ShowInLegend = true;
            Window window = new Window();
            window.Content = chart;
            window.Show();
            if (_isLoaded)
            {
                dataSeries.Legend = "Legend1";
                Assert.AreEqual("Legend1", dataSeries.Legend);
            }
            window.Dispatcher.InvokeShutdown();
            window.Close();
        }
Beispiel #5
0
        public void HorizontalAlignmentNewValue()
        {
            Chart chart = new Chart();
            chart.Width = 400;
            chart.Height = 300;
            

            Legend legend = new Legend();
            legend.SetValue(FrameworkElement.NameProperty, "Legend0");
            chart.Legends.Add(legend);

            CreateAndAddDefaultDataSeries(chart);
             
            _isLoaded = false;
            chart.Loaded += new RoutedEventHandler(chart_Loaded);

            Window window = new Window();
            window.Content = chart;
            window.Show();
            if (_isLoaded)
            {
                legend.HorizontalAlignment = HorizontalAlignment.Left;
                Assert.AreEqual(HorizontalAlignment.Left, legend.HorizontalAlignment);
            }

            window.Dispatcher.InvokeShutdown();
            window.Close();
        }
Beispiel #6
0
        public void TestLegendAlignmentInSection()
        {
            Chart chart = new Chart();
            chart.Width = 400;
            chart.Height = 350;
            chart.View3D = true;

            TestPanel.Children.Add(chart);

            Legend legend = new Legend();
            legend.SetValue(FrameworkElement.NameProperty, "Legend0");
            legend.Title = "Legend";
            chart.Legends.Add(legend);

            Common.CreateAndAddDefaultDataSeries(chart);
            chart.Series[0].RenderAs = RenderAs.SectionFunnel;
            chart.Series[0].ShowInLegend = true;

            EnqueueDelay(_sleepTime);

            EnqueueCallback(() =>
            {
                legend.HorizontalAlignment = HorizontalAlignment.Left;
                legend.VerticalAlignment = VerticalAlignment.Bottom;
            });

            EnqueueDelay(_sleepTime);

            EnqueueCallback(() =>
            {
                legend.HorizontalAlignment = HorizontalAlignment.Left;
                legend.VerticalAlignment = VerticalAlignment.Center;
            });

            EnqueueDelay(_sleepTime);

            EnqueueCallback(() =>
            {
                legend.HorizontalAlignment = HorizontalAlignment.Left;
                legend.VerticalAlignment = VerticalAlignment.Top;
            });

            EnqueueDelay(_sleepTime);

            EnqueueCallback(() =>
            {
                legend.HorizontalAlignment = HorizontalAlignment.Center;
                legend.VerticalAlignment = VerticalAlignment.Top;
            });

            EnqueueDelay(1000);

            EnqueueCallback(() =>
            {
                legend.HorizontalAlignment = HorizontalAlignment.Right;
                legend.VerticalAlignment = VerticalAlignment.Top;
            });

            EnqueueDelay(_sleepTime);

            EnqueueCallback(() =>
            {
                legend.HorizontalAlignment = HorizontalAlignment.Right;
                legend.VerticalAlignment = VerticalAlignment.Center;
            });

            EnqueueDelay(1000);

            EnqueueCallback(() =>
            {
                legend.HorizontalAlignment = HorizontalAlignment.Right;
                legend.VerticalAlignment = VerticalAlignment.Bottom;
            });

            EnqueueDelay(_sleepTime);

            EnqueueCallback(() =>
            {
                legend.HorizontalAlignment = HorizontalAlignment.Center;
                legend.VerticalAlignment = VerticalAlignment.Bottom;
            });

            EnqueueTestComplete();
        }
Beispiel #7
0
        public void EnabledNewValue()
        {
            Chart chart = new Chart();
            chart.Width = 400;
            chart.Height = 300;
            

            Legend legend = new Legend();
            legend.SetValue(FrameworkElement.NameProperty, "Legend0");
            chart.Legends.Add(legend);

            CreateAndAddDefaultDataSeries(chart, legend);
            
            CreateAsyncTask(chart,
                () => legend.Enabled = false,
                () => Assert.AreEqual(false, legend.Enabled));

            EnqueueTestComplete();
        }
Beispiel #8
0
        public void OpacityNewValue()
        {
            Chart chart = new Chart();
            chart.Width = 400;
            chart.Height = 300;
            

            Legend legend = new Legend();
            legend.SetValue(FrameworkElement.NameProperty, "Legend0");
            legend.Title = "Legend";
            chart.Legends.Add(legend);

            CreateAndAddDefaultDataSeries(chart);

            _isLoaded = false;
            chart.Loaded += new RoutedEventHandler(chart_Loaded);

            Window window = new Window();
            window.Content = chart;
            window.Show();
            if (_isLoaded)
            {
                legend.Opacity = 0.5;
                Assert.AreEqual(0.5, legend.Opacity, Common.HighPrecisionDelta);
            }

            window.Dispatcher.InvokeShutdown();
            window.Close();
        }
Beispiel #9
0
        public void BorderThicknessNewValue()
        {
            Chart chart = new Chart();
            chart.Width = 400;
            chart.Height = 300;

            Legend legend = new Legend();
            legend.SetValue(FrameworkElement.NameProperty, "Legend0");
            chart.Legends.Add(legend);

            CreateAndAddDefaultDataSeries(chart, legend);

            CreateAsyncTask(chart,
                () => legend.BorderThickness = new Thickness(2),
                () => Assert.AreEqual(new Thickness(2), legend.BorderThickness));

            EnqueueTestComplete();
        }
Beispiel #10
0
        public void DockInsidePlotAreaNewValue()
        {
            Chart chart = new Chart();
            chart.Width = 400;
            chart.Height = 300;
            

            Legend legend = new Legend();
            legend.SetValue(FrameworkElement.NameProperty, "Legend0");
            chart.Legends.Add(legend);

            CreateAndAddDefaultDataSeries(chart, legend);

            CreateAsyncTask(chart,
                () => legend.DockInsidePlotArea = true,
                () => Assert.IsTrue(legend.DockInsidePlotArea));

            EnqueueTestComplete();
        }
Beispiel #11
0
        public void HorizontalAlignmentNewValue()
        {
            Chart chart = new Chart();
            chart.Width = 400;
            chart.Height = 300;

            Legend legend = new Legend();
            legend.SetValue(FrameworkElement.NameProperty, "Legend0");
            chart.Legends.Add(legend);

            CreateAndAddDefaultDataSeries(chart, legend);

            CreateAsyncTask(chart,
                () => legend.HorizontalAlignment = HorizontalAlignment.Left,
                () => Assert.AreEqual(HorizontalAlignment.Left, legend.HorizontalAlignment));

            EnqueueTestComplete();
        }
Beispiel #12
0
        public void HrefNewValue()
        {
            Chart chart = new Chart();
            chart.Width = 400;
            chart.Height = 300;

            Legend legend = new Legend();
            legend.SetValue(FrameworkElement.NameProperty, "Legend0");
            chart.Legends.Add(legend);

            CreateAndAddDefaultDataSeries(chart, legend);

            CreateAsyncTask(chart,
                () => legend.HrefTarget = HrefTargets._blank,
                () => legend.Href = "http://",
                () => Assert.AreEqual("http://", legend.Href));

            EnqueueTestComplete();
        }
Beispiel #13
0
        public void LegendEventChecking()
        {
            System.Windows.Browser.HtmlPage.Plugin.SetStyleAttribute("height", "400px");

            Chart chart = new Chart();
            chart.Width = 400;
            chart.Height = 300;

            TestPanel.Children.Add(chart);

            Legend legend = new Legend();
            legend.SetValue(FrameworkElement.NameProperty, "Legend0");
            legend.Title = "Legend";
            chart.Legends.Add(legend);

            CreateAndAddDefaultDataSeries(chart, legend);

            legend.MouseEnter += delegate(Object sender, MouseEventArgs e)
            {
                _htmlElement.SetProperty("value", "Legend MouseEnter event fired");
            };

            legend.MouseLeave += delegate(Object sender, MouseEventArgs e)
            {
                _htmlElement.SetProperty("value", "Legend MouseLeave event fired");
            };

            legend.MouseLeftButtonUp += delegate(Object sender, MouseButtonEventArgs e)
            {
                _htmlElement.SetProperty("value", "Legend MouseLeftButtonUp event fired");
            };

            legend.MouseLeftButtonDown += delegate(Object sender, MouseButtonEventArgs e)
            {
                _htmlElement.SetProperty("value", "Legend MouseLeftButtonDown event fired");
            };

            EnqueueCallback(() =>
            {
                _htmlElement.AttachEvent("onclick", new EventHandler<System.Windows.Browser.HtmlEventArgs>(this.LegendTest_OnClick));
            });

            _htmlElement = Common.GetDisplayMessageButton(_htmlElement);
            _htmlElement.SetStyleAttribute("width", "900px");
            _htmlElement.SetProperty("value", "Click here to exit.");
            System.Windows.Browser.HtmlPage.Document.Body.AppendChild(_htmlElement);

        }
Beispiel #14
0
        public void TitleBackgroundNewValue()
        {
            Chart chart = new Chart();
            chart.Width = 400;
            chart.Height = 300;
            

            Legend legend = new Legend();
            legend.SetValue(FrameworkElement.NameProperty, "Legend0");
            legend.Title = "Legend";
            chart.Legends.Add(legend);

            CreateAndAddDefaultDataSeries(chart);
             
            _isLoaded = false;
            chart.Loaded += new RoutedEventHandler(chart_Loaded);

            Window window = new Window();
            window.Content = chart;
            window.Show();
            if (_isLoaded)
            {
                legend.TitleBackground = new SolidColorBrush(Colors.Gray);
                Common.AssertBrushesAreEqual(new SolidColorBrush(Colors.Gray), legend.TitleBackground);
            }

            window.Dispatcher.InvokeShutdown();
            window.Close();
        }
Beispiel #15
0
        public void FontColorNewValue()
        {
            Chart chart = new Chart();
            chart.Width = 400;
            chart.Height = 300;
            

            Legend legend = new Legend();
            legend.SetValue(FrameworkElement.NameProperty, "Legend0");
            chart.Legends.Add(legend);

            CreateAndAddDefaultDataSeries(chart, legend);

            CreateAsyncTask(chart,
                () => legend.FontColor = new SolidColorBrush(Colors.Red),
                () => Common.AssertBrushesAreEqual(new SolidColorBrush(Colors.Red), legend.FontColor));

            EnqueueTestComplete();
        }
Beispiel #16
0
        public void TitleFontFamilyNewValue()
        {
            Chart chart = new Chart();
            chart.Width = 400;
            chart.Height = 300;
            

            Legend legend = new Legend();
            legend.SetValue(FrameworkElement.NameProperty, "Legend0");
            legend.Title = "Legend";
            chart.Legends.Add(legend);

            CreateAndAddDefaultDataSeries(chart);
             
            _isLoaded = false;
            chart.Loaded += new RoutedEventHandler(chart_Loaded);

            Window window = new Window();
            window.Content = chart;
            window.Show();
            if (_isLoaded)
            {
                legend.TitleFontFamily = new FontFamily("Times New Roman");
                Assert.AreEqual(new FontFamily("Times New Roman"), legend.TitleFontFamily);
            }

            window.Dispatcher.InvokeShutdown();
            window.Close();
        }
Beispiel #17
0
        public void FontSizeNewValue()
        {
            Chart chart = new Chart();
            chart.Width = 400;
            chart.Height = 300;
            

            Legend legend = new Legend();
            legend.SetValue(FrameworkElement.NameProperty, "Legend0");
            chart.Legends.Add(legend);

            CreateAndAddDefaultDataSeries(chart, legend);

            CreateAsyncTask(chart,
                () => legend.FontSize = 14,
                () => Assert.AreEqual(14, legend.FontSize, Common.HighPrecisionDelta));

            EnqueueTestComplete();
        }
Beispiel #18
0
        public void HrefNewValue()
        {
            Chart chart = new Chart();
            chart.Width = 400;
            chart.Height = 300;
            

            Legend legend = new Legend();
            legend.SetValue(FrameworkElement.NameProperty, "Legend0");
            chart.Legends.Add(legend);

            CreateAndAddDefaultDataSeries(chart);
             
            _isLoaded = false;
            chart.Loaded += new RoutedEventHandler(chart_Loaded);

            Window window = new Window();
            window.Content = chart;
            window.Show();
            if (_isLoaded)
            {
                legend.HrefTarget = HrefTargets._blank;
                legend.Href = "http://www.visifire.com";
                Assert.AreEqual("http://www.visifire.com", legend.Href);
            }

            window.Dispatcher.InvokeShutdown();
            window.Close();
        }
Beispiel #19
0
        public void FontFamilyNewValue()
        {
            Chart chart = new Chart();
            chart.Width = 400;
            chart.Height = 300;
            

            Legend legend = new Legend();
            legend.SetValue(FrameworkElement.NameProperty, "Legend0");
            chart.Legends.Add(legend);

            CreateAndAddDefaultDataSeries(chart, legend);

            CreateAsyncTask(chart,
                () => legend.FontFamily = new FontFamily("Times New Roman"),
                () => Assert.AreEqual(new FontFamily("Times New Roman"), legend.FontFamily));

            EnqueueTestComplete();
        }
Beispiel #20
0
        public void BorderThicknessNewValue()
        {
            Chart chart = new Chart();
            chart.Width = 400;
            chart.Height = 300;
            

            Legend legend = new Legend();
            legend.SetValue(FrameworkElement.NameProperty, "Legend0");
            legend.BorderColor = new SolidColorBrush(Colors.Red);
            chart.Legends.Add(legend);

            CreateAndAddDefaultDataSeries(chart);
             
            _isLoaded = false;
            chart.Loaded += new RoutedEventHandler(chart_Loaded);

            Window window = new Window();
            window.Content = chart;
            window.Show();
            if (_isLoaded)
            {
                legend.BorderThickness = new Thickness(2);
                Assert.AreEqual(new Thickness(2), legend.BorderThickness);
            }

            window.Dispatcher.InvokeShutdown();
            window.Close();
        }
Beispiel #21
0
        public void FontStyleNewValue()
        {
            Chart chart = new Chart();
            chart.Width = 400;
            chart.Height = 300;
            

            Legend legend = new Legend();
            legend.SetValue(FrameworkElement.NameProperty, "Legend0");
            chart.Legends.Add(legend);

            CreateAndAddDefaultDataSeries(chart, legend);

            CreateAsyncTask(chart,
                () => legend.FontStyle = FontStyles.Italic,
                () => Assert.AreEqual(FontStyles.Italic, legend.FontStyle));

            EnqueueTestComplete();
        }
Beispiel #22
0
        public void CheckLegendProperty()
        {
            Chart chart = new Chart();
            chart.Width = 600;
            chart.Height = 300;

            Random rand = new Random();

            DataSeries dataSeries = CreateDataSeries();

            Legend legend = new Legend();
            legend.SetValue(FrameworkElement.NameProperty, "Legend0");
            chart.Legends.Add(legend);

            dataSeries.ShowInLegend = true;
            chart.Series.Add(dataSeries);

            EnqueueDelay(_sleepTime);
            CreateAsyncTask(chart,
                () => dataSeries.Legend = "Legend0",
                () => Assert.AreEqual("Legend0", dataSeries.Legend));

            EnqueueTestComplete();
        }
Beispiel #23
0
        public void LightingEnabledNewValue()
        {
            Chart chart = new Chart();
            chart.Width = 400;
            chart.Height = 300;
            

            Legend legend = new Legend();
            legend.SetValue(FrameworkElement.NameProperty, "Legend0");
            legend.Background = new SolidColorBrush(Colors.Red);
            chart.Legends.Add(legend);

            CreateAndAddDefaultDataSeries(chart, legend);

            CreateAsyncTask(chart,
                () => legend.LightingEnabled = true,
                () => Assert.IsTrue(legend.LightingEnabled));

            EnqueueTestComplete();
        }