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 Bill,
Thank you for your post. I have been looking into it and I can say that you can inherit from ScatterBase class, which is subclass of Series, but you are not able to inherit from ScatterSeries, because it is sealed. In the link you provided it is written that you can inherit from Series class and there is an example of how to achieve this.
Hope this helps you.
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!