Target Color

2 posts, 0 answers
  1. Patrick
    Patrick avatar
    20 posts
    Member since:
    Jan 2018

    Posted 03 May 2018 Link to this post

    Should be really simple.... cannot find any documentation and the demo is lacking...

    How do you set the target color from the helper?

     

    @(Html.Kendo()
                .Sparkline()
                .Name("sprkFundsDisbursed")
                .Type(SparklineType.Bullet)
                .HtmlAttributes(new { style = "text-align: left; width:100%; line-height:30px;" })
                .Tooltip(tooltip => tooltip.Format("{0}%"))
                .SeriesColors(new string[] {"blue"})
                 
                .ValueAxis(axis => axis
                    .Numeric()
                    .Min(0)
                    .Max(100)
     
                    .PlotBands(bands => {
                        bands.Add().From(0).To(95).Color("#787878").Opacity(0.15);
                        bands.Add().From(95).To(100).Color("#787878").Opacity(0.3);
                    })
                    )
                     
                    .Data(new double[] { 43, 95 })
  2. Tsvetina
    Admin
    Tsvetina avatar
    2481 posts

    Posted 07 May 2018 Link to this post

    Hi Patrick,

    The Target color can be configured if there is an explicit Bullet series definition, because the Target property is specific to this series type only:
    @model IEnumerable<TelerikMvcApp26.Models.Bullet>
     
    @(Html.Kendo().Sparkline(Model)
         .Name("sparkline")
         .Series(s=>s.Bullet(m=>m.Current, m=>m.Target).Target(t=>t.Color("green")))
    )


    Regards,
    Tsvetina
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top