Pre loader

Generic XyzDataSeries restriction

Welcome to the SciChart Forums!

  • Please read our Question Asking Guidelines for how to format a good question
  • Some reputation is required to post answers. Get up-voted to avoid the spam filter!
  • We welcome community answers and upvotes. Every Q&A improves SciChart for everyone

WPF Forums | JavaScript Forums | Android Forums | iOS Forums

Answered
2
1

Hi,

I am trying to create a chart with additional information, similarly as discussed in this question:
https://www.scichart.com/questions/question/correlating-metadata-with-datapoints/
It works fine for simple information, such as enums, that I can cast into a double (see also the example provided in the question mentioned above).

However it seems that there is a restriction on the generic class XyzDataSeries.
Whenever I try to use a different data types for TY and TZ

XyzDataSeries<DateTime, double, int>

I get the following exception at runtime:

SciChartSurface didn’t render, because an exception was thrown:

Message: Das Objekt des Typs "Abt.Controls.SciChart.Wpf.StoreEditor1[System.Int32]" kann nicht in Typ "System.Collections.Generic.IList1[System.Double]" umgewandelt werden.

  Stack Trace:    bei Abt.Controls.SciChart.Wpf.NetworkResolver1.Execute(ResamplingMode resamplingMode, IndexRange pointRange, Int32 viewportWidth, Boolean isFifo, Boolean isCategoryAxis, IList xColumn, IList yColumn, Nullable1 dataIsSorted, Nullable1 dataIsEvenlySpaced, Nullable1 dataIsDisplayedAs2d, IRange visibleXRange)
   bei Abt.Controls.SciChart.Model.DataSeries.XyzDataSeries`3.ToPointSeries(ResamplingMode resamplingMode, IndexRange pointRange, Int32 viewportWidth, Boolean isCategoryAxis, Nullable1 dataIsDisplayedAs2D, IRange visibleXRange, IPointResamplerFactory factory)
   bei Abt.Controls.SciChart.Wpf.MethodManager.ListStream(AxisCollection urlAvailable, IRenderableSeries lockInitialized, RenderPassInfo valuesHeader, IPointResamplerFactory addressMap, IDataSeries& nextName, IndexRange& previousValues, IPointSeries& syncObjectHandle)
   bei Abt.Controls.SciChart.Wpf.MethodManager.ListStream(ISciChartSurface urlAvailable, Size lockInitialized)
   bei Abt.Controls.SciChart.Wpf.MethodManager.RenderLoop(IRenderContext2D renderContext)
   bei Abt.Controls.SciChart.Visuals.SciChartSurface.DoDrawingLoop()

Sorry for the german. The message translates to:

The object of type [...] cannot be casted into type [...]

I’m quite confused about this. It works nicely, if I use the same data types for TY and TZ .

XyzDataSeries<DateTime, double, double>
XyzDataSeries<DateTime, int, int>

This is not what I would expect from a generic type with three types.
If the types for Y and Z values need to be of the same type, the class should rather look something like this: XyzDataSeries<TX, TYZ>.
The API documentation does not mention anything about this. It only states that the types need to be IComparables, which seems not the full truth.

This is a problem for me, because I have more complex metadata than a double, which I want to reference over the Z value.
But I don’t want to use an index of type double. I’d rather use a GUID or even add the metadata object itself as Z value.

Is this by design or is this something that could be fixed in the future?

Do you have a suggestion how to best reference point related metadata (without having to implement my own DataSeries)?

  • You must to post comments
Best Answer
0
0

UPDATE: SciChart v4 now supports Metadata natively on data-points.

Please see our related FAQ Correlating DataPoints with Metadata for more information

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.

Try SciChart Today

Start a trial and discover why we are the choice
of demanding developers worldwide

Start TrialCase Studies