Inconsistent behavior of C1.Win.Chart.FlexPie

Posted by: nitin on 15 May 2020, 3:50 pm EST

    • Post Options:
    • Link

    Posted 15 May 2020, 3:50 pm EST

    Hi,

    I am using C1.Win.Chart.FlexPie in VB. I am generating the Pie Chart dynamically. I have enabled the animation, Tooltip, DataLabel.

    I noticed that the Chart control behaves inconsistently.

    1. Sometimes it do not responds to the clicks. Means after clicking many times on the pie slice it responds.
    2. The tool tips are shown every time I take the cursor over it.
    3. The left side pie slices never responds to any clicks or tooltips.
  • Posted 17 May 2020, 10:25 pm EST

    Hi,

    Regarding (1),(3): I could observe that the MouseClick event doesn’t trigger only when mouse cursor is over the displayed Tooltip. And this behavior is not specific to the left side pie slices. Could you please verify my observations with the attached sample at your end and let us know if we are missing something? Once you verify this I can proceed further to discuss it with the dev team.

    Regarding (2): I’m sorry as I could not understand this issue. Whenever you move mouse over slice the Tooltip will be re-displayed as per the new mouse position. Could you please explain what exactly you are expecting here?

    Regards,

    Basant

    FlexPieClick.zip

  • Posted 19 May 2020, 6:55 pm EST - Updated 3 October 2022, 2:51 pm EST

    Sir,

    I have tested your solution and is is running perfectly allright. However I noticed that I am using a C1SplitterPanel where there are multiple Panels and each Panel is having 1 Chart (Dashboard Screen).

    I have attached the screenshot of one Pie chart and marked the area where the tooltips are not visible. Following the modified code.

    I have seen that is I enable the Baloon Tool Tip then the area become much smaller.

    
               Dim FlexPieX As New FlexPie
               FlexPieX.Text = sTileCaption
               FlexPieX.Dock = DockStyle.Fill
                'FlexPieX.Palette = Palette.Cocoa
                ''Binding FlexPie's AxisX to 'Value' so values appear in Horizontal axis
                FlexPieX.BindingName = "CName"
                FlexPieX.Binding = "CValue"
                ''Specify what and how to show data values
                FlexPieX.DataLabel.Content = "{name}: {p:0}%"
                'Specify where to position the data labels relative to pie slices
                FlexPieX.DataLabel.Position = C1.Chart.PieLabelPosition.Radial
                'FlexPieX.DataLabel.Overlapping = C1.Chart.OverlappingLabels.Show
                ''Setting FlexPie's Header
                ''FlexPieX.Header.Content = sReportCaption
                'FlexPieX.Header.HorizontalAlignment = HorizontalAlignment.Center
    
                '' Apply animation to pie chart 
                FlexPieX.AnimationSettings = C1.Chart.AnimationSettings.All
                'FlexPieX.AnimationUpdate.Easing = C1.Chart.Easing.Swing
                'FlexPieX.AnimationUpdate.Duration = 500
                'FlexPieX.AnimationLoad.Type = C1.Chart.AnimationType.All
    
                FlexPieX.InnerRadius = 0.5
                FlexPieX.Offset = 0
                'FlexPieX.ToolTip.Active = True
                FlexPieX.ToolTip.Content = "{name} : {value}"
    
                FlexPieX.Legend.Position = Position.Auto
                FlexPieX.Legend.TextWrapping = TextWrapping.Truncate
                FlexPieX.Legend.Orientation = C1.Chart.Orientation.Auto
                FlexPieX.Legend.Position = Position.None
                FlexPieX.ToolTip.IsBalloon = False
    
                'Passing data in FlexPie
                FlexPieX.DataSource = dt ' Data Table
                PanelPIE.Controls.Add(xFlexPie)
    
    

  • Posted 19 May 2020, 10:02 pm EST

    Hi,

    Thanks for confirming and sharing the code snippet & snapshot. I could observe that the issue may occur when LegendPosition = None and FlexPie.BindingName is set. HitTest may result in incorrect information for some points(near to the top) in that case and hence the issues.

    Since this is a bug, I have escalated it to the devs (TFS ID: 342576). However, as a workaround if it seems feasible, you may avoid setting FlexPie.BindingName (as you don’t want to display legends) and replace the {name} template string parameter (wherever used) with the property name that you would have set for the BindingName as follows:

    FlexPieX.BindingName = ""
    FlexPieX.DataLabel.Content = "{CName}: {p:0}%"
    FlexPieX.ToolTip.Content = "{CName} : {value}"
    

    Regards,

    Basant

  • Posted 19 May 2020, 11:47 pm EST

    Sir,

    Now I am getting one more Issue. I am using your sample code and I have changed the InitData(). I am using values from the Database.

    
    Private Sub InitData()
            Dim dt = New DataTable()
    
            dt = GeDataFomDatabase()
            Data = New ObservableCollection(Of Object)()
            Dim idx As Long = 0
    
            For Each row In dt.Rows
                Data.Add(New With {.X = row.item(0).ToString, .Y = row.item(1).ToString})
                idx += 1
            Next
        End Sub
    
    

    While using this code ClickedOnPie() function is failing for the first item / slice in the Pie. It returns zero for hitTest.PointIndex. I have tried several Data Tables and same issue is coming.

  • Posted 20 May 2020, 4:05 pm EST

    Hi Nitin,

    I tried to imitate the pie chart whose snapshot you provided earlier. I also modified the InitData() as you specified but still could not reproduce the issue at my end. Could you please verify with the attached modified sample and share your observations.

    As per your description, it seems like the HitTest result for the first slice is faulty (i.e. PointIndex= 0 but Item is null). Could you please confirm what is the exact issue upon clicking the first slice (e.g. StackTrace or Exception info if any) and if possible please update the attached sample to reproduce the issue.

    Regards,

    Basant

  • Posted 28 May 2020, 4:02 am EST

    Hi,

    I tried various Data Sources and got the same issue. After clicking on the first Slice message box is not appearing.

  • Posted 28 May 2020, 4:47 pm EST

    Hi Nitin,

    Let me confirm the following:

    1) Is this behavior occurring even using the workaround suggested(i.e. not setting BindingX when LegendPosition = None)? If not, then as I informed you earlier this is a bug and need to be fixed in control itself. You can try the workaround and let us know if the issue still persist.

    2) If the issue persists even after not setting BindingX then It might depend on the HitTest result and how you are handling the click. Could you please verify with the attached sample and try to see what is causing the issue?

    If possible, I would request you to either make changes in the attached sample or provide a stripped down sample that reproduce the issue. That would be helpful to locate the issue and assist you faster.

    Regards,

    Basant

    FlexPieSample_Mod.zip

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels