Subsets Different Points 3
1//! Showing use of Jagged Data, subsets with different amounts of Data.2//! Showing use of XDataPtr and YDataPtr and using local memory instead of passing data to chart.3 4CreateSimpleSGraph(Pesgo1);5 6Pesgo1.PeConfigure.RenderEngine = RenderEngine.Direct2D;7Pesgo1.PeData.JaggedData = true; // For now Direct3D does not support JaggedData, only use with Direct2D.8 9Pesgo1.PeData.Subsets = 4;10Pesgo1.PeData.Points = 1;11 12Random rn = new Random();13int i = rn.Next(4500); // randomize the start of waveform data to produce variation14Array.Copy(MainWindow.tmpYData, i, MainWindow.wavedata, 0, 10000);15Array.Copy(MainWindow.tmpYData, i + 125000, MainWindow.wavedata2, 0, 10000);16Array.Copy(MainWindow.tmpYData, i + 250000, MainWindow.wavedata3, 0, 10000);17Array.Copy(MainWindow.tmpYData, i + 375000, MainWindow.wavedata4, 0, 10000);18 19// Note below we set one pointer for x data, and 4 pointers for y data (1 for each subset)20 21// This examples uses one large array of memory for Y Data, but one may22// use multiple arrays, one for each subset of y data.23 24Pesgo1.PeData.DuplicateDataX = DuplicateData.PointIncrement;25 26Pesgo1.PeData.X.UseJaggedDataAtLocation(MainWindow.wavedatax, 0); // only one subset because using DuplicateDataX = PointIncrement27 28Pesgo1.PeData.Y.UseJaggedDataAtLocation(MainWindow.wavedata, 0); // plots based off local array, data not copied or transferred.29Pesgo1.PeData.Y.UseJaggedDataAtLocation(MainWindow.wavedata2, 1);30Pesgo1.PeData.Y.UseJaggedDataAtLocation(MainWindow.wavedata3, 2);31Pesgo1.PeData.Y.UseJaggedDataAtLocation(MainWindow.wavedata4, 3);32 33Pesgo1.PePlot.Bitmaps.WorkingBitmap = 0;34Pesgo1.PePlot.Bitmaps.Filename = "symbolBlueDot.png"; // Define a blue dot symbol bitmap resource35Pesgo1.PePlot.Bitmaps.Style = ResourceBitmapStyle.SmallCentered; // bitmap symbols plot faster though vector output is not poosible36Pesgo1.PePlot.SubsetPointTypes[3] = (PointType)10001; // 4th subset, set to WorkingBitmap 0, 10001 + Working Bitmap Index37Pesgo1.PePlot.Bitmaps.WorkingBitmap = 1;38Pesgo1.PePlot.Bitmaps.Filename = "symbolRedDot.png"; // Define a blue dot symbol bitmap resource39Pesgo1.PePlot.Bitmaps.Style = ResourceBitmapStyle.SmallCentered; // bitmap symbols plot faster though vector output is not poosible40Pesgo1.PePlot.SubsetPointTypes[0] = (PointType)10001 + 1; // 1st subset, set to WorkingBitmap 0, 10001 + Working Bitmap Index41Pesgo1.PePlot.Bitmaps.WorkingBitmap = 2;42Pesgo1.PePlot.Bitmaps.Filename = "symbolPurpleDot.png"; // Define a blue dot symbol bitmap resource43Pesgo1.PePlot.Bitmaps.Style = ResourceBitmapStyle.SmallCentered; // bitmap symbols plot faster though vector output is not poosible44Pesgo1.PePlot.SubsetPointTypes[1] = (PointType)10001 + 2; // 2nd subset, set to WorkingBitmap 0, 10001 + Working Bitmap Index45Pesgo1.PePlot.Bitmaps.WorkingBitmap = 3;46Pesgo1.PePlot.Bitmaps.Filename = "symbolGreenDot.png"; // Define a blue dot symbol bitmap resource47Pesgo1.PePlot.Bitmaps.Style = ResourceBitmapStyle.SmallCentered; // bitmap symbols plot faster though vector output is not poosible48Pesgo1.PePlot.SubsetPointTypes[2] = (PointType)10001 + 3; // 3rd subset, set to WorkingBitmap 0, 10001 + Working Bitmap Index49 50Pesgo1.PeUserInterface.Dialog.AllowWmfExport = false;51Pesgo1.PeUserInterface.Dialog.AllowEmfExport = false;52Pesgo1.PeUserInterface.Dialog.Style = false;53 54Pesgo1.PePlot.DataShadows = DataShadows.None;55 56Pesgo1.PePlot.Method = SGraphPlottingMethod.Line;57 58// Generally call ReinitializeResetImage at end **'59Pesgo1.PeConfigure.RenderEngine = RenderEngine.Direct2D;60Pesgo1.PeFunction.ReinitializeResetImage();61Pesgo1.Invalidate();62// Optionally call Pesgo1.Refresh() if you are not seeing changes immediatelyPego1.PeData.Y[s, p]Click underlined properties to view documentation