【问题标题】:How to add mutiple color kendo UI Chart如何添加多种颜色的剑道 UI 图表
【发布时间】:2018-06-14 13:33:51
【问题描述】:

我正在使用 Kendo UI Chart,我想绘制一个具有多种颜色的图表。

我正在使用如下代码:

@(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))
                                                   )
)

但它为每个条显示一种颜色。 我想在每个栏中显示不同的颜色。 请帮我创建多种颜色的图表。

【问题讨论】:

    标签: kendo-ui telerik telerik-charting


    【解决方案1】:

    我不熟悉 kendo ui chart api,但您似乎可能需要指定更多系列数据,如下所示:

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

    【讨论】:

      猜你喜欢
      • 2013-08-29
      • 1970-01-01
      • 1970-01-01
      • 2019-06-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-03-20
      相关资源
      最近更新 更多