0
votes

I need a ShieldUI JavaScript pie chart that use on a page in which some slices are preselected. I researched the available resources and pretty much figured it out. However my further intention is to return back(or collapse back) preselected slices in place after the user clicks on the pie or on another pie slice. Here is some of my code:

dataSeries: [{
seriesType:'pie',
collectionAlias:'Usage',
    data: [
        ['Category A', 44.2],
        ['Category B', 22.2],
        ['Category C', 20],
        {
collectionAlias:'Category C',
            y: 12.8,
            selected: true
        },
        ['Category D', 20],
        {
collectionAlias:  'Category D',
            y: 22.8,
            selected: true
        },
        ['Category E', 20],
        {
collectionAlias: 'Category E',
            y: 32.8,
            selected: true
        },

    ]
}]

I assumed the selected property might be the problem and changed it to sliced:

dataSeries: [{
seriesType:             'pie',
collectionAlias:             'Usage',
    data: [
        ['Category A', 44.2],
        ['Category B', 22.2],
        ['Category C', 20],
        {
collectionAlias: 'Category C',
            y: 12.8,
            sliced: true
        },
        ['Category D', 20],
        {
collectionAlias: 'Category D',
            y: 22.8,
            sliced: true
        },
        ['Category E', 20],
        {
collectionAlias:'Category E',
            y: 32.8,
            sliced: true
        },

    ]
}]

However the result is still the same. I can hover the slices- they change color, but nothing more. The preselected ones remain off center.

1

1 Answers

0
votes

As it seems from your partial code one reason I can think of, especially judging by the resulting behavior, is that you have omitted the enablePointSelection property. you need to set it to true similar to this code:

seriesSettings: {
  pie: {
       enablePointSelection: true,
       slicedOffset: 19
       }
 },

The obvious reason for that is that in order to put back the preselected slices you need to be able to select another one.