Is there a way to plot a data source that just consists of just Y values?
Background:
I have to plot a series of values coming from a data acquisition card (Analog to Digital) with 12 bits or so of resolution [call it 2 bytes] at a fixed 10Khz sample rate. I need to plot a couple of minutes worth of samples (1,200,000 samples). I will be converting it to “floats” before plotting. It does not have to be in real time.
We’re talking a lot of data: 10,000 samples a second X 120 seconds X 8 channels X bytes-per-sample.
I’d like to avoid creating XY points in my source (and doubling the memory use) when the X values don’t actually matter.
Thoughts?
Thanks!
- You must login to post comments
here’s how I handle something like that (note, I use MVVM-ish code, and I’m using a list of doubles instead of an array)
public class LineChart
{
public IXyDataSeries<double, double> DataSeries { get; set; }
public LineChart(string seriesName)
{
DataSeries = new XyDataSeries<double, double>()
{
SeriesName = seriesName
};
}
public void UpdateChart(List<double> dataPoints)
{
DataSeries.Clear();
for (int i = 0; i < dataPoints.Count; i++)
{
DataSeries.Append(i, dataPoints[i]);
}
}
}
and in the View/ViewModel that does the charting:
public class MainWindowViewModel : ViewModelBase
{
private readonly SensorDataModel mySensorDataModel;
public myLineChart LineChart { get; }
public MainWindowViewModel()
{
myLineChart = new LineChart();
mySensorDataModel = new SensorDataModel ();
}
private void UpdateCharts(object sender, EventArgs e)
{
if (mySensorDataModel.DataPoints.Count >= 10)
{
myLineChart.UpdateChart(mySensorDataModel.DataPoints);
//Tell the view there is new data
NotifyPropertyChanged("myDataSeries");
}
}
}
- Branden Gunn answered 8 years ago
- last edited 8 years ago
- You must login to post comments
I am considering applying server-side licensing for my javerScript application.
In the document below, there is a phrase “Our server-side licensing component is written in C++.”
(https://support-dev.scichart.com/index.php?/Knowledgebase/Article/View/17256/42/)
However, there is only asp.net sample code on the provided github.
(https://github.com/ABTSoftware/SciChart.JS.Examples/tree/master/Sandbox/demo-dotnet-server-licensing)
I wonder if there is a sample code implemented in C++ for server-side licensing.
Can you provide c++ sample code?
Also, are there any examples to run on Ubuntu?
- Christopher Bennet answered 8 years ago
-
not sure how it doesn’t answer your question. Please hit the “add comment” link under my answer to explain more.
- You must login to post comments
(I couldn’t figure out how to get good formatting using “add comment” so I used the normal method.)
I reread my question and your answer again and now I see how my question was confusing. Sorry.
Instead of:
public IXyDataSeries<double, double> DataSeries { get; set; }
I’d was hoping there was something like this:
public IJustYDataSeries<float> DataSeries { get; set; }
Perhaps I am worried about memory for nothing though. Premature optimization and all that…
- Christopher Bennet answered 8 years ago
- last edited 8 years ago
-
Hi Chris, SciChart DataSeries always store the X-value, it’s not possible to have just Y values in the Data-Series I’m afraid.
-
That would explain why I couldn’t find it! Thank you so much for you help.
- You must login to post comments
Please login first to submit.