【问题标题】:How can I change Kendo Chart's Background Image?如何更改剑道图表的背景图像?
【发布时间】:2014-09-15 23:53:22
【问题描述】:

如何使用此代码更改剑道图表的背景?有可能吗?

.HtmlAttributes(new { style = "background: url('~/shared/pics/harita.png')" })

这有什么问题?

【问题讨论】:

    标签: javascript kendo-ui telerik kendo-chart


    【解决方案1】:

    请对您的图表进行以下更改以在背景中显示图像。

    1. 在图表定义中,确保您已将图表区域背景设置为透明。 见下文:

      @(Html.Kendo().StockChart<ChartModel>()
       .Name("stockDemoChart")
       .................
       .................
       .ChartArea(chartArea => chartArea.Background("transparent"))
      
    2. 您可以根据图表名称设置样式,而不是在 HtmlAttributes 中指定图表背景。见下文:

      <style>
         #stockDemoChart {
         background: center no-repeat url('@Url.Content("~/shared/pics/demo.png")')
         }
      </style>
      

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2010-10-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-27
      • 2012-03-17
      • 1970-01-01
      相关资源
      最近更新 更多