Telerik Forums
UI for ASP.NET MVC Forum
3 answers
114 views

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 })
Tsvetomir
Telerik team
 answered on 06 Feb 2020
3 answers
129 views
Is there a way to generate a static sparkline chart on the server? I'd like to include a sparkline in a system-generated email.
Tsvetina
Telerik team
 answered on 21 Jun 2017
4 answers
459 views
I'm trying to add a sparkline column into a grid.
I've tried using a client template to do this, but it just shows [object HTMLScriptElement] in the column, rather than the chart.

I have a template:-
<script id="sparkTemplate" type="text/kendo-tmpl">
 
     @(Html.Kendo().Sparkline()
                        .Name("temp-log_#=ID#")
                        .Type(SparklineType.Column)
                        .Tooltip(tooltip => tooltip.Format("{0} °C"))
                         
                        .Data(ViewBag.TemperatureData)
                        .ToClientTemplate()
               )
 
</script>
This doesn't yet have pass any parameters to the controller - but obviously this will be needed as well.
The grid is:-
        @(Html.Kendo().Grid<CMS_2013.Models.CMSSummaryOne>()
.Name("tabGrid")
.Columns(columns=>
    {columns.Bound(p=>p.DivisionName).Title("Division");
    columns.Bound(p => p.Specialty).Title("Specialty");
    columns.Bound(p => p.Activity).Title("Activity");
    columns.Bound(p => p.Plan).Title("Plan");
    columns.Bound(p => p.Variance).Title("Variance").ClientTemplate("#= formatNumber(Variance) #");
    columns.Bound(p => p.Variance).Title("Variance").ClientTemplate("#=sparkTemplate#");
    })
     
     
   
    .Pageable()
    .Sortable()
    .Selectable()
 
    .DataSource(dataSource=>dataSource
        .Ajax()
        .PageSize(5)
         
        .Read(read=>read.Action("GetTableData","Dashboard")
        .Data("chartFilter")
        )
        )
         
   
       )

What's the best way to embed a chart into a column - I specifically want the chart in a column and not a detail template - something a sparkline looks ideal for.

Thanks
Dimiter Madjarov
Telerik team
 answered on 08 Sep 2015
5 answers
181 views
Hi!

Is it possible to have a sparkline inside a listview HTML template?
If so, what is the best practice regardning binding it to data?

Regards,
Per
Iliana Dyankova
Telerik team
 answered on 18 Jun 2014
6 answers
224 views
I'm trying to set up a sparkline, and I've got it working.

However, the tool tip shows the data field name, as well as the value, unlike your demos, where just the number is shown.
@(Html.Kendo().Sparkline()
.Name("BatchTimeSpark")
.Type(SparklineType.Column)
.DataSource(ds=>ds
    .Read(read => read.Action("GetBatchStats", "Home"))
  )
  .Series(s=>s
      .Column("RunLength")
  )
   
   
  )
I've attached a screenshot of the tool tip.
Also, what's the best way to set the height. My chart seems very short (the values are small, but I expected it to scale).

Thanks
--
AP
Top achievements
Rank 1
Iron
Iron
Veteran
 answered on 02 Apr 2013
Narrow your results
Selected tags
Tags
Grid
General Discussions
Scheduler
DropDownList
Chart
Editor
TreeView
DatePicker
Upload
ComboBox
MultiSelect
ListView
Window
TabStrip
Menu
Installer and VS Extensions
Spreadsheet
AutoComplete
TreeList
Gantt
PanelBar
NumericTextBox
Filter
ToolTip
Map
Diagram
Button
PivotGrid
Form
ListBox
Splitter
Application
FileManager
Sortable
Calendar
View
MaskedTextBox
PDFViewer
TextBox
Toolbar
MultiColumnComboBox
Dialog
DropDownTree
Checkbox
Slider
Switch
Notification
ListView (Mobile)
Pager
Accessibility
ColorPicker
DateRangePicker
Wizard
Security
Styling
Chat
MediaPlayer
TileLayout
DateInput
Drawer
SplitView
Barcode
ButtonGroup (Mobile)
Drawer (Mobile)
ImageEditor
RadioGroup
Stepper
TabStrip (Mobile)
GridLayout
Template
Badge
LinearGauge
ModalView
ResponsivePanel
TextArea
Breadcrumb
ExpansionPanel
Rating
ScrollView
ButtonGroup
CheckBoxGroup
NavBar
ProgressBar
QRCode
RadioButton
Scroller
Timeline
TreeMap
TaskBoard
OrgChart
Captcha
ActionSheet
Signature
DateTimePicker
AppBar
BottomNavigation
Card
FloatingActionButton
Licensing
Localization
MultiViewCalendar
PopOver (Mobile)
Ripple
ScrollView (Mobile)
Switch (Mobile)
PivotGridV2
FlatColorPicker
ColorPalette
DropDownButton
AIPrompt
PropertyGrid
ActionSheet (Mobile)
BulletGraph
Button (Mobile)
Collapsible
Loader
CircularGauge
SkeletonContainer
Popover
HeatMap
Avatar
ColorGradient
CircularProgressBar
SplitButton
StackLayout
TimeDurationPicker
Chip
ChipList
DockManager
ToggleButton
Sankey
OTPInput
ChartWizard
SpeechToTextButton
InlineAIPrompt
TimePicker
StockChart
RadialGauge
ContextMenu
ArcGauge
AICodingAssistant
+? more
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Iron
Iron
Andrey
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Iron
Iron
Andrey
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?