Pie Explode

1 posts, 0 answers
  1. Philip Senechal
    Philip Senechal avatar
    152 posts
    Member since:
    Apr 2008

    Posted 04 Sep 2012 Link to this post

    Hello...I'm using the Razor syntax for creating my pie chart and am having problems figuring out how to explode a slice using a databound pie chart. Here is the code that I thought would work...the object that is feeding the Pie has 2 attributes: Label holds the name and Value holds the value.
                                .Title(title => title
                                    .Text("MY ALLOCATION")
                                    .Font("16px Oswald")
                                .Legend(legend => legend
                                .ChartArea(chartArea => chartArea
                                .DataSource(ds => ds
                                    .Read(read => read.Action("dMyAllocation", "Dashboard", new { area = "InfoSource.Metrics" }))
                                .Series(series => {
                                    series.Pie(model => model.Value, model => model.Label, null, model => model.Label == "Unassigned" ? true : false)
                                        .Labels(labels => labels
                                .Events(events => events
                                .Tooltip(tooltip => tooltip
                                        .Template("${dataItem.Label} - ${value}%")
                                .HtmlAttributes(new { style = "max-height: 300px;" })

    From what I can understand, the series syntax includes on option for true/false if the pie should explode or not. I have set mine up using the Label text so that if the Label text is "Unassigned", the pie piece should explode. This is not happening however.

    Can you let me know if my syntax is correct or not? Thanks.
Back to Top