Normally, if I have a ScichartSurface with a X- and Y-Axis, were both axis AutoRange- properties are set to Always, the surface displays the entire data by adjusting the Visible ranges of the axis after new data has been appended.
This also works if there are multiple Data-Series on the ScichartSurface.
In my case, I have two FastLineRenderableSeries on my Surface. Each of them receiving new data via the Append-function while the x- and y-axis are continuously adjusted automatically to display all the datapoints of both Datasets.
So far so good…
But what would I have to do if I wanted one of the two Datasets to be ignored by the Autorange properties of the x- and y-Axis?
I have already tried to set the X- and YAxisID of one dataset to null, hoping I could make both axis ignore this Dataset while they are adjusting their Visible ranges. However, this only led to error messages.
I could also try to write my own ViewPortManagers and overwrite the OnCalculateNewXRange and OnCalculateNewYRange funvtions, but that seems a little bit excessive.
Is there an easy way to achieve the desired behavior?
- You must login to post comments
The SciChart-official way to do this is to have the series in question on a separate Y-Axis, which is hidden.
e.g. imagine a chart like this
- Primary X,Y Axis with ID as the default = “DefaultAxisID”
- Second hidden YAxis with ID=”secondary” and Visibility collapsed
- Now register all series but one on primary X,Y axis by leaving XAxisId, YAxisId = default
- Your special series you want to maximise, register this with YAxisID=”secondary”
This will maximise the special series to the viewport and it will be unaffected by auto ranging on the other axis
This can be repeated ad-infinitum. If you wanted all series to be maximised to viewport nothing is stopping you from having N series and N hidden YAxis. If you get into the 1000s of YAxis then performance problems can occur, for that we recommend
SlimAxis. Contact our support for more details as this is a niche feature for precisely this use-case.
Hello Andrew, thank you for the quick reply (as always). Maybe I did not phrase it correctly, but I don’t want both DataSeries to be maximized simultaneously. What I want is for the first Dataseries to be maximized (i.e. shown in its entirety), while the second (the “ignored”) one is displayed according to the same VisibleRanges (for the x-and y- Axis) as the first one. So the X/Y-Axis should always adjust their ranges to scale the entire first DataSeries onto the Surface, but the second Series (which is scaled by the same X/Y-Axis) would be not necessarily be shown entirely but (depending on the size of the first DataSeries) partially, entirely, or not at all. However, your answer as led me to a working solution: I did what you just said, having two separate and hidden X,Y axis wit ID “secondary” and the second Series with X/YAxisID = “secondary”. The original X/Y-axis have Autorange=Always while the hidden ones have Autorange=Never. Now I did an one-way Binding of the VisibleRange-Property between the visible X-Axis and the hidden X-Axis. I did the same for the Y-axis. Now the two visible axis “controll” the two invisible ones, creating the desired effect.
Nice! Do you care to share the solution and the outcome in a screenshot as answer to your post? It would help others understand what you’ve done. I could also suggest improvements if I see them. Images can be uploaded to Imgur or similar and linked into the post.
- You must login to post comments
Please login first to submit.