Skip to content

Commit e84cfed

Browse files
author
Marin Bratanov
committed
responsive sparkline chart
1 parent 4c12aaf commit e84cfed

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

controls/htmlchart/chart-types/sparkline-chart.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,50 @@ Protected Function GetData() As DataTable
251251
End Function
252252
````
253253

254+
>tip Sparkline charts are intended to be small inline elements. If you need a [responsive chart](http://demos.telerik.com/aspnet-ajax/htmlchart/examples/functionality/responsive-chart/defaultcs.aspx), you can hide some of the elements of the `Default` layout. See **Example 2**.
255+
256+
>caption Example 3: Responsive chart that looks like a sparkline chart
257+
258+
````ASP.NET
259+
<style type="text/css">
260+
html, body, form
261+
{
262+
height: 100%;
263+
margin: 0;
264+
padding: 0;
265+
}
266+
</style>
267+
<telerik:RadHtmlChart runat="server" Width="100%" Height="100%" ID="RadHtmlChart1">
268+
<Legend>
269+
<Appearance Visible="false"></Appearance>
270+
</Legend>
271+
<PlotArea>
272+
<XAxis Visible="false">
273+
<MajorGridLines Visible="false" />
274+
<MinorGridLines Visible="false" />
275+
</XAxis>
276+
<YAxis Visible="false">
277+
<MajorGridLines Visible="false" />
278+
<MinorGridLines Visible="false" />
279+
</YAxis>
280+
<Series>
281+
<telerik:ColumnSeries>
282+
<SeriesItems>
283+
<telerik:CategorySeriesItem Y="1" />
284+
<telerik:CategorySeriesItem Y="2" />
285+
<telerik:CategorySeriesItem Y="3" />
286+
</SeriesItems>
287+
</telerik:ColumnSeries>
288+
</Series>
289+
</PlotArea>
290+
</telerik:RadHtmlChart>
291+
<script type="text/javascript">
292+
window.onresize = function () {
293+
$find("<%=RadHtmlChart1.ClientID%>").get_kendoWidget().resize();
294+
}
295+
</script>
296+
````
297+
254298
## See Also
255299

256300
* [RadHtmlChart Server-side Programming Overview]({%slug htmlchart/server-side-programming/overview%})

0 commit comments

Comments
 (0)