Hi,
We are developing a customized series for our XamDataChart control and show it with other ScatterLineSerieses together in one chart. The issue is other ScatterLineSerieses have set up MaximumMarkers to make sure whatever zoom of the chart, they show fixed number of markers. We do not know how Infragistics calculates the markers so we hope to write a customized series inheriting from ScatterSeries or ScatterBase. The problem is the former class is sealed and the latter class has an internal constructor that we cannot call.
However on the online document:http://help.infragistics.com/Help/NetAdvantage/WPF/2012.1/CLR4.0/html/xamDataChart_Creating_Custom_Series.html
it says we can inherit from ScatterSeries.
Could you please help me how to achieve this function? I really appreciate it.
Thanks,
Bill
Hello,
In order to turn off the visrtulaization of the Markers, you can set the MaximumMarkers Property to 100 000 e.g., but this way the performace of the XamDataChart will decrease dramatically.
Hope this helps you.
MaximumMarkers property works for one series, it does not work for showing markers for multiple series which require markers have the same x axis.
Assuming a PointViewModel has X, Y, Y1, Y2. I want to show three serieses with fixed number of markers. All markers align by x axis and draw a small line between each marker on Y1 and marker on Y2, MaximumMarkers cannot do this.
Hello Bill,
I have been looking into your sample and I can say that since the XamDataChart’s Markers are virtualized this behavior is expected and I can suggest you set the Series’ MaximumMarkers Property instead of binding Marker’s Visibility.
Hi Stefan,
Attachment shows when points are larger than 1000, the ScatterLineSeries cannot show correct number of markers.
Thanks,Bill
Hi Stafen,
Thanks for reply. When I tried to create a class inheriting from ScatterBase, I got an error message that "Cannot get access internal constructor 'ScatterBase' here."
Another issue that if I use a marker template inside a ScatterLineSeries to control the number of markers I want to show:
<ig:ScatterLineSeries.MarkerTemplate> <DataTemplate> <Ellipse Width="10" Height="10" Fill="{Binding ActualBrush, RelativeSource={RelativeSource AncestorType=ig:ScatterLineSeries}}" HorizontalAlignment="Center" VerticalAlignment="Center" Visibility="{Binding Item.IsMarkerShown, UpdateSourceTrigger=PropertyChanged, Converter={StaticResource boolToVisibilityConverter}}"/> </DataTemplate></ig:ScatterLineSeries.MarkerTemplate>
The marker will be shown very randomly, which seems binding is not working correctly. At 100 points there is no issue, no matter how you resize or zoom in/out, but when points are larger than 1000, the series cannot display correct number of markers. What is the problem?
I use a behavior in the XamDataChart level to handle its WindowRectChanged and ViewportRectChanged events and inside the event handler, I modify the point viewmodels' IsMarkShown property which are located inside the rect to control number of markers shown on the series. I am not sure whether this way is accurate since there are event handlers for both WindowRectChanged and ViewportRectChanged inside Series also. A competition might exist. However I do not think this point cannot fully explain above issue since when chart initializes at first time, all points' viewmodels are already there and there is no competition but issure still exists.
Temporarily I wrote a customized series inheriting from Series to control accurat number of markers it shows, since this series shows no line, but markers. But it brings up another question: How to make axis swappable? We used ScatterLineSeries before so this function is simple, just swap XMemberPath and YMemberPath. But how could I implement this in a customized series? I defined both XAxis and YAxis in XAML since they will be shared with other series and they are both NumericAxis. The swap function will affect all serieses.
Thanks!