Sunil Gakhar
Sunil Gakhar

Reputation: 1

How to add mutiple color kendo UI Chart

I am using Kendo UI Chart, I want to draw a chart with multiple colors.

I am using code like:

@(Html.Kendo().Chart()
                                            .Name("chart")
                                            .Title("D I S C")
                                            .Legend(legend => legend
                                                .Visible(false)
                                            )
                                            .Series(series =>
                                            {

                                                series.Column(new int[] { 94,66,12,12 }).Color("#ff0000");
                                                
                                            })
                                            .CategoryAxis(axis => axis
                                                       .Name("series-axis")
                                                       .Categories("94","66","12","12")
                                                       //.Categories
                                                       .Line(line => line.Visible(false))
                                                   )
)

but its showing one color for each bar. i want to show different color in every bar. Please help me to create chart with multiple color.

Upvotes: 0

Views: 305

Answers (1)

mike123
mike123

Reputation: 1559

I'm not familiar with kendo ui chart api, but it seem like you may need to specify more series of data, like this:

.Series(series =>
{
  series.Column(new int[] { 94 }).Color("#ff0000");
  series.Column(new int[] { 66 }).Color("#ffff00");
  series.Column(new int[] { 12 }).Color("#00ff00");
})

Upvotes: 0

Related Questions