Bug when setting series visibility in Silverlight
Posted: Thu Sep 08, 2011 12:15 pm
There seems to be a serious performance issue when setting the visibility of a series multiple times in teechart silverlight dll version 4.1.2011.7283.
The following silverlight user control contains a TChart with a single series of 10 random points. Each second the visibility of the series is switched. For the first ~10 ticks, the application works as expected; the series is shown for a second, hidden for a second and repeats.
However, for each tick, the time used to show the series increases. After ~10-20 ticks, showing the series is so slow it never even shows up!
This completely breaks my current application, so I request it to be fixed as soon as possible.
MainPage.xaml
MainPage.xaml.cs
The following silverlight user control contains a TChart with a single series of 10 random points. Each second the visibility of the series is switched. For the first ~10 ticks, the application works as expected; the series is shown for a second, hidden for a second and repeats.
However, for each tick, the time used to show the series increases. After ~10-20 ticks, showing the series is so slow it never even shows up!
This completely breaks my current application, so I request it to be fixed as soon as possible.
MainPage.xaml
Code: Select all
<UserControl x:Class="TestTeeChart.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:TC="clr-namespace:Steema.TeeChart.Silverlight;assembly=TeeChart.Silverlight"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="400">
<TC:TChart x:Name="TChart" Height="300" Width="400" />
</UserControl>
Code: Select all
using System;
using System.Windows.Controls;
using System.Windows.Threading;
using Steema.TeeChart.Silverlight.Styles;
namespace TestTeeChart
{
public partial class MainPage : UserControl
{
private Points series;
public MainPage()
{
InitializeComponent();
// Create and add seres
TChart.Series.Add(series = new Points());
// Fill random data
Random r = new Random();
for (int i = 0; i < 10; i++)
series.Add(i, r.Next());
// Create and start timer
DispatcherTimer timer = new DispatcherTimer();
timer.Interval = new TimeSpan(0, 0, 0, 1);
timer.Tick += (s, a) => { series.Visible = !series.Visible; };
timer.Start();
}
}
}