Unable to clear series

Hi, normally when "clearing" a series so that nothing is displayed, it is enough to have series.ItemsSource = Nothing. However, this does not work when LabelsPosition is Inside or when PrimaryAxis is Collapsed.

Attached is a sample.

Source A and B contain data, but C does not. When switching to C the chart is all black, which is correct. Now, change back to A, but change the label position to Inside or Collapsed, then switch to C. The A series are still visible, which is wrong.

I've tried to create a workaround by setting chartPrimaryAxis.LabelsPosition = AxisElementPosition.Outside when the series contains no data, but this doesn't work.

Please help to resolve this issue so that the series can be cleared when label position is set to Inside or Collapsed.

Thank you.

Attachment: sfChartClearTest_47669c6a.rar

3 Replies

MK Muneesh Kumar G Syncfusion Team May 7, 2018 09:38 AM UTC

Hi Tom, 
 
We have analyzed your sample, we have found visible range for CustomLogarithmicAxis set with -infinity value while setting ItemsSource as Nothing. We can resolve this problem by checking the min and max value as per the below code snippet. 
 
Code Snippet: [ CustomLogarithmicAxis] 
Public Sub ZoomY(visibleXRange As DoubleRange, area As SfChart) 
        Dim MinLogY, MaxLogY As Double 
        Dim Ymax, Ymin As Double 
 
        GetExtremes(visibleXRange.Start, visibleXRange.End, Ymax, Ymin, area) 
 
        If Ymax > 0 & Ymin > 0 Then 
 
            MinLogY = Math.Log(Ymin, 2) 
            MaxLogY = Math.Log(Ymax, 2) 
 
            Me.VisibleRange = New DoubleRange(MinLogY, MaxLogY) 
        End If 
 
    End Sub 
 
Please let us know if you have any queries. 
 
Thanks, 
Muneesh Kumar G. 
 



TO Tom May 7, 2018 11:13 AM UTC

Thank you Muneesh, this is greatly appreciated.


MK Muneesh Kumar G Syncfusion Team May 8, 2018 04:57 AM UTC

Hi Tom, 
 
Thanks for the update. 
 
We are glad to know that the given solution works. Please let us know if you need any further assistance. 
 
Thanks, 
Muneesh Kumar G. 
 


Loader.
Up arrow icon