Selection

20 Mar 20181 minute to read

SunburstChart provides selection support for the points on mouse click. To enable the selection , set the Enable property to true in the SelectionSettings.

  • CSHTML
  • @(Html.EJ().SunburstChart("chartContainer")
    
         .SelectionSettings(selection=>selection.Enable(true))
     )

    Selection Display mode

    You can customize the selected segment appearance by using color or opacity. You can choose between color or opacity using the Type selection Settings.

    • selectionByColor – To display the selected segment appearance using color.
    • selectionByOpacity – To display the selected segment appearance using opacity.
  • CSHTML
  • @(Html.EJ().SunburstChart("chartContainer")
    
         .SelectionSettings(selection=>selection.Enable(true).Type(SunburstSelectionType.Color).Color("Red"))
     )

    Selection Mode

    Sunburst chart provides multiple option to represent the selected categories. You can select the segment categories by using the Mode property in selectionSettings

    • Child – To selection the child of selected parent.
    • All – To selection the entire categories in group.
    • Parent – To selection the parent of selected child.
    • Single - To selection single item in the category.

    Child

    The following code shows how to set the selection type as child

  • CSHTML
  • @(Html.EJ().SunburstChart("chartContainer")
    
         .SelectionSettings(selection=>selection.Enable(true).Mode(SunburstSelectionMode.Child))
     )

    Parent

    The parent mode can be enabled by using the below code

  • CSHTML
  • @(Html.EJ().SunburstChart("chartContainer")
    
         .SelectionSettings(selection=>selection.Enable(true).Mode(SunburstSelectionMode.Parent))
     )

    Point

    To selection the particular segment, the point mode of the selection settings is used.

  • CSHTML
  • @(Html.EJ().SunburstChart("chartContainer")
    
         .SelectionSettings(selection=>selection.Enable(true).Mode(SunburstSelectionMode.Point))
     )

    All

    The following code snippet is used for the all mode of selection settings

  • CSHTML
  • @(Html.EJ().SunburstChart("chartContainer")
    
         .SelectionSettings(selection=>selection.Enable(true).Mode(SunburstSelectionMode.All))
     )

    Click here to view the online demo sample of Selection in the Sunburst Chart.