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(); }
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(); }
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(); }
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(); }
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(); }
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(); }
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(); }
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(); }
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(); }
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(); }
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(); }
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(); }
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); }
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(); }
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(); }
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(); }
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(); }
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(); }
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(); }
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(); }
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(); }
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(); }
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(); }