Date Axis in a Telerik Reports Line Graph

462 views Asked by At

Does anyone know how to set up a date time axis to use DateTime Scale in a line graph in Telerik Reports? I have been trying to figure it out for over a week now. I don't understand why this thing has to be so difficult to use. I started by setting up a line graph.

I have three columns DATE, SALES_COUNT, and SALES_TYPE. I want there to be three lines on the graph. One for each value of SALES_TYPE. I used SALES_TYPE for the series, SALES_COUNT for the value, and since I didn't have any other options left, I used DATE for Categories. I clicked finish and previewed my graph. The graph looked right except I wanted to make a few customization to the DATE axis. Specifically I only wanted it to write out a date label for every 5 ticks or so. There was no way to do this.

Eventually I figured out that I have to set the axis to use DateTime Scale since it defaults to Category Scale. I set it to date time scale and previewed the graph again. I got the error: "X value cannot be null or empty when using DateTimeScale, lineSeries1", so I went to lineSeries1 and set the X value to "= Fields.DATE", and clicked preview. Now the graph nolonger displays any of my data points, and there is only one tick on the DateTime axis and its labeled as 1/1/2015 12:00:00 AM, a DateTime that is not even in my dataset. I have been struggling for over a week now to figure out how to do this simple task. Please help me.

1

There are 1 answers

0
Michael S. Miller On

The SQL query I was using was handed to me by the DBA. I never really looked at it, I just stuffed it into the report. It turns out the query was returning the DATE column as a varchar. Once I cast the DATE column as a date in the select column list of the query, Setting the axis to use DateTime Scale worked fine. If anyone else runs into a similar problem, check the return types of your columns.