TelerikDeveloper.com

TelerikDeveloper.com

Archives

 

This article will show how to create a line chart using the Telerik Win Form charting controls and save it to disk

In a recent project I needed to set out statistics to users. I had the idea of creating a chart, saving it to disk, and then emailing it out nightly. In the code sample below I walk through the process of creating the chart and then saving it. 

In a separate article I'll cover how to include it in an email. 

It's all pretty self explanatory, but one difficulty I had was in dealing with the dates. The chart doesn't handle date types, you have to convert them to Julian dates in the SQL query to get them to work, like this:

datediff(day,'1/1/1900',logdate) + 2 as julianDate

You'll also see 'ToAODate()' in the code, that's the VB way of doing the same thing.