Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
20
Implementing a stacked column chart
posted

I am fairly new to mvc and ignite, and I am trying to implement a stacked column chart in my mvc ingite UI project.

all of the samples of a stacked chart that I have found use a javascript function to build the chart, but I would like to do it directly in the cshtml code.

the functions I have seen all use series.type to set the type to stacked, but I have been unable to find an equivalent variable outside of the javascript

here is my code

@(Html.Infragistics().DataChart(Model.orders.AsQueryable())
.ID("test")
.Height("300px")
.Axes(a =>
    {
        a.CategoryX("Label").Label(cl => cl.dayName);
        a.NumericY("Amount").MinimumValue(0).MaximumValue(500000);
        
    })

.Series(s =>
    {
        s.Column("Delivery").XAxis("Label").YAxis("Amount").ValueMemberPath(vv => vv.pickupAmount);
        s.Column("Amounts").XAxis("Label").YAxis("Amount").ValueMemberPath(cc => cc.deliveryAmount);                  
    })
.DataBind()
.Render()
)

Thanks in advance!