This is a migrated thread and some comments may be shown as answers.

Target Color

3 Answers 9 Views
Sparkline
This is a migrated thread and some comments may be shown as answers.
Patrick
Top achievements
Rank 1
Patrick asked on 03 May 2018, 08:22 PM

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 })

3 Answers, 1 is accepted

Sort by
0
Tsvetina
Telerik team
answered on 07 May 2018, 02:47 PM
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.
0
terrysmith
Top achievements
Rank 1
answered on 04 Feb 2020, 10:27 PM
I've spent hours on this same issue and searched your doc multiple times before finding this post. This should be in your product documentation, not "documented" in this forum post.
0
Tsvetomir
Telerik team
answered on 06 Feb 2020, 01:09 PM

Hi Terry,

All of the functionalities that are exposed by a certain widget are documented and placed in the API reference of the respective widget. Since the documentation aims for clarifying a whole concept a functionality rather than very specific ones, you could search in the API article of the Sparkline widget:

https://docs.telerik.com/aspnet-mvc/api/sparkline

For instance, if you type in "bullet", all of the additional options will be displayed and you would be able to check out the color option as well.

 

Regards,
Tsvetomir
Progress Telerik

Get quickly onboarded and successful with your Telerik UI for ASP.NET MVC with the dedicated Virtual Classroom technical training, available to all active customers.
Tags
Sparkline
Asked by
Patrick
Top achievements
Rank 1
Answers by
Tsvetina
Telerik team
terrysmith
Top achievements
Rank 1
Tsvetomir
Telerik team
Share this question
or