Hello,
we are building an application where Charts are created/placed by the user in a form of editor.
We observed that the creation of the first Chart takes between 1 to 3 seconds (depending on the system) but the creation of subsequent Charts takes virtually no time (as it should be).
We assume that the creation of the first Chart involves some kind of time consuming initialization that is later used in the creation of subsequent Charts.
So we have researched if there is a way to do this initialization at the start of our application, so the user is not inconvenienced by a three second waiting time while placing the first Chart.
We discovered the “LoadLibrariesAndLicenseAsync”-function. However, it looks like it has no measurable effect.
Maybe we are using it wrong?
Here is an example code to illustrate the problem in a condensed manner:
Two charts are created and each time the time it takes to create them is measured.
The first creation takes about 1600 milliseconds, the second one only 2.
How can we make both creations only take a few milliseconds?
Thank you.
// SciChartSurface.SetRuntimeLicenseKey("our key");
await SciChart.Charting.Visuals.SciChart2DInitializer.LoadLibrariesAndLicenseAsync(
"our key",
null); //...does not seem to work
Stopwatch sw = new Stopwatch();
sw.Restart();//start stopwatch
//creating the first Scichart with test data:
SciChartSurface sciChartSurface = new SciChartSurface();
XyDataSeries<double, double> xyDataSeries = new XyDataSeries<double, double>();
xyDataSeries.AcceptsUnsortedData = true;
FastLineRenderableSeries fastLineRenderableSeries = new FastLineRenderableSeries();
fastLineRenderableSeries.DataSeries = xyDataSeries;
sciChartSurface.RenderableSeries.Add(fastLineRenderableSeries);
NumericAxis m_xAxis = new NumericAxis();
NumericAxis m_yAxis = new NumericAxis();
m_yAxis.AutoRange = AutoRange.Always;
sciChartSurface.XAxis = m_xAxis;
sciChartSurface.YAxis = m_yAxis;
using (xyDataSeries.SuspendUpdates())
{
for (int i = 0; i < 100; i++)
xyDataSeries.Append(i, Math.Sin(i));
}
Screen.Children.Add(sciChartSurface);//add first Scichart to grid
sciChartSurface.Margin = new Thickness(0, 0, 500, 0);
MessageBox.Show("time: "+sw.ElapsedMilliseconds); ////////// 1610 Mlliseconds
sw.Restart();//restart stopwatch
//creating the second Scichart with test data:
SciChartSurface sciChartSurface2 = new SciChartSurface();
XyDataSeries<double, double> xyDataSeries2 = new XyDataSeries<double, double>();
xyDataSeries2.AcceptsUnsortedData = true;
FastLineRenderableSeries fastLineRenderableSeries2 = new FastLineRenderableSeries();
fastLineRenderableSeries2.DataSeries = xyDataSeries2;
sciChartSurface2.RenderableSeries.Add(fastLineRenderableSeries2);
NumericAxis m_xAxis2 = new NumericAxis();
NumericAxis m_yAxis2 = new NumericAxis();
m_yAxis2.AutoRange = AutoRange.Always;
sciChartSurface2.XAxis = m_xAxis2;
sciChartSurface2.YAxis = m_yAxis2;
using (xyDataSeries2.SuspendUpdates())
{
for (int i = 0; i < 100; i++)
xyDataSeries2.Append(i, Math.Sin(i));
}
Screen.Children.Add(sciChartSurface2);//add second Scichart to grid
sciChartSurface2.Margin = new Thickness(500, 0, 0, 0);
MessageBox.Show("time: "+sw.ElapsedMilliseconds); //////////////////////////// 2 Mlliseconds
- Marc Vahldieck asked 2 months ago
- last active 2 months ago
Hello!
I’m building an application where I need to display quiet a large number of charts next to each other.
In this app the user can select up to 16 devices at the same time, each device having 24 channels of measurement data.
So in the worst case there could be 384 charts visible at the same time.
Usually it’s more likely to be around 24 or 48.
The user will also be switching between different views to monitor the devices he’s working with so UI elements need to be reloaded and repopulated more than once.
I have realized that this might not be possible to do with SciChart as loading 24 charts on their own already takes about a second or two.
I already have placed a call to “SciChart2DInitializer.LoadLibrariesAndLicenseAsync().Wait();” in my startup part of my software.
The chart itself is quiet simple and it is placed within an ItemsControl to be populated as many times as required.:
<ItemsControl Grid.Row="1" ItemsSource="{Binding Path=Data}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<s:SciChartSurface
x:Name="sciChartSurface"
Margin="10"
s:ThemeManager.Theme="BrightSpark"
Background="White"
Style="{x:Null}">
<s:SciChartSurface.RenderSurface>
<s:XamlRenderSurface />
</s:SciChartSurface.RenderSurface>
<s:SciChartSurface.YAxes>
<s:NumericAxis
x:Name="reflectanceAxis"
AxisAlignment="Left"
Id="reflectanceAxis"
IsPrimaryAxis="True" />
</s:SciChartSurface.YAxes>
<s:SciChartSurface.XAxis>
<s:DateTimeAxis x:Name="timeAxis" Id="timeAxis" />
</s:SciChartSurface.XAxis>
<s:SciChartSurface.RenderableSeries>
<s:FastLineRenderableSeries XAxisId="timeAxis" YAxisId="reflectanceAxis" />
</s:SciChartSurface.RenderableSeries>
</s:SciChartSurface>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
Is there any way that I can improve the loading performance even further?
Attached you can find a stripped down sample project which demonstrates the slow load times I’m experiencing.
There is also a picture attached where you can see that loading 24 charts blocks the UI thread for about 1.5 seconds.
I am using the latest SciChart version currently available (6.2.1.13304)
- Michael Kollmann asked 2 years ago
- last active 2 years ago
Hello,
I’m evaluating SciChart v6.1 for a WPF realtime charting application.
So far everything has worked well, except some issues with very slow loading.
On my machine, any app referencing SciChart takes around 5-6 seconds to initialize before the app can continue loading.
Some debugging with dotTrace shows most of the time is spent in the constructor of SciChartSurface calling the Charting2DNativeDllsLoader constructor.
dev machine is Windows 10 Pro x64, core i7, 32GB ram
Visual Studio 2019 Pro
To duplicate create new WPF application, .NET Framework v4.8
In MainWindow constructor add two lines:
SciChartSurface.SetRuntimeLicenseKey("[TRIAL KEY]");
var tmp = new SciChartSurface();
Executing the second line takes around 5-6 seconds.
I have uploaded a sample project that duplicates this issue and dotTrace result.
Let me know if I can provide any other info.
- Steven Hansen asked 3 years ago
- last active 3 years ago