How are you?
I was sent an e-mail.
But no reply and write for the forum.
The first question.
I want to fix the X-Axis Label from real-time charts.
Was attached my sample project.
To draw a fixed X-axis Label in real-time charts should you proceed as sample projects?
The second question.
This Exception occur in the following scenarios.
1. Add Multiple Series and YAxes.
2. Remove using a "RemoveAt" method Series and YAxes in the middle.
The sample project was attached.
My OS: Windows7 64bit
VS: VisualStudio 2013 Professional
Thank you.
==================================================================
Exception
Message : Invalid Y axis index
HResult : -2146233088
TargetSite : {Boolean LTB(Int32)}
StackTrace :
위치: Arction.LightningChartUltimate.SeriesXY.SeriesBaseXY.LTB(Int32 A)
위치: Arction.LightningChartUltimate.SeriesXY.SeriesBaseXY.SetSubNodeOwners(IChartNode ownerNode)
위치: Arction.LightningChartUltimate.SeriesXY.PointLineSeriesBase.SetSubNodeOwners(IChartNode ownerNode)
위치: Arction.LightningChartUltimate.Views.ViewXY.ViewXY.SetSubNodeOwners(IChartNode ownerNode)
위치: Arction.LightningChartUltimate.LightningChartUltimate.NCC(Object A, EventArgs B)
위치: System.Windows.Forms.Timer.TimerNativeWindow.WndProc(Message& m)
위치: System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
위치: System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
위치: System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
위치: System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
위치: System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
위치: YAxesControl.Program.Main() 파일 e:\Work\Project\LightningChart\Chart영역_추가삭제\YAxesControl\YAxesControl\Program.cs:줄 18
위치: System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
위치: Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
위치: System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
위치: System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
위치: System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
위치: System.Threading.ThreadHelper.ThreadStart()
YAxes and Series RemoveAt
Moderator: Queue Moderators
YAxes and Series RemoveAt
- Attachments
-
- CustomXAxisLables.zip
- [The first Question]
Sample project - (207.45 KiB) Downloaded 523 times
-
- [The first Question]
Fixed Custom Label image - customLabel.png (98.64 KiB) Viewed 6244 times
- [The first Question]
-
- YAxesControl.zip
- [The second question.]
Sample project - (59.75 KiB) Downloaded 484 times
- ArctionPasi
- Posts: 1367
- Joined: Tue Mar 26, 2013 10:57 pm
- Location: Finland
- Contact:
Re: YAxes and Series RemoveAt
Hi,
we replied to you by e-mail today morning. Please note different European and Asian time zones, and our office is closed during weekend. There can be 0.5 - 2 days processing queue.
First question
Rendering labels with GDI over the chart is not a good approach, because of flickering and performance hit.
I think you want to keep the X axis range the same all the time, even if the data scrolls in the chart. You can achieve that easier by adding 2nd X axis and setting it's range from 0...10 seconds. Attach the series to 1st X axis, and hide that axis by setting ViewXY.XAxes[0].Visible = false. In monitoring, increment 1st X axis ScrollPosition, but leave 2nd X axis ScrollPosition as it is. That's probably the easiest and performance-efficient way.
Second question
After deleting, the series must be assigned with new AssignYAxisIndexes again, otherwise they get wrong axis reference.
Like this:
private void btnRemove_Click(object sender, EventArgs e)
{
chart.BeginUpdate();
ViewXY viewXY = this.chart.ViewXY;
if (viewXY.YAxes.Count != 0)
{
viewXY.SampleDataSeries.RemoveAt(0);
viewXY.YAxes.RemoveAt(0);
//Change AssignYAxisIndex for remaining SampleDataSeries
foreach (SampleDataSeries series in chart.ViewXY.SampleDataSeries)
{
series.AssignYAxisIndex = viewXY.SampleDataSeries.IndexOf(series);
}
}
chart.EndUpdate();
}
General tips
We strongly recommend using
chart.BeginUpdate...chartEndUpdate around the code you update the chart. Like that, the chart renders faster and doesn't flicker.
we replied to you by e-mail today morning. Please note different European and Asian time zones, and our office is closed during weekend. There can be 0.5 - 2 days processing queue.
First question
Rendering labels with GDI over the chart is not a good approach, because of flickering and performance hit.
I think you want to keep the X axis range the same all the time, even if the data scrolls in the chart. You can achieve that easier by adding 2nd X axis and setting it's range from 0...10 seconds. Attach the series to 1st X axis, and hide that axis by setting ViewXY.XAxes[0].Visible = false. In monitoring, increment 1st X axis ScrollPosition, but leave 2nd X axis ScrollPosition as it is. That's probably the easiest and performance-efficient way.
Second question
After deleting, the series must be assigned with new AssignYAxisIndexes again, otherwise they get wrong axis reference.
Like this:
private void btnRemove_Click(object sender, EventArgs e)
{
chart.BeginUpdate();
ViewXY viewXY = this.chart.ViewXY;
if (viewXY.YAxes.Count != 0)
{
viewXY.SampleDataSeries.RemoveAt(0);
viewXY.YAxes.RemoveAt(0);
//Change AssignYAxisIndex for remaining SampleDataSeries
foreach (SampleDataSeries series in chart.ViewXY.SampleDataSeries)
{
series.AssignYAxisIndex = viewXY.SampleDataSeries.IndexOf(series);
}
}
chart.EndUpdate();
}
General tips
We strongly recommend using
chart.BeginUpdate...chartEndUpdate around the code you update the chart. Like that, the chart renders faster and doesn't flicker.
LightningChart Support Team, PT
Re: YAxes and Series RemoveAt
Thank you so much.