简体   繁体   English

Telerik报告折线图中的日期轴

[英]Date Axis in a Telerik Reports Line Graph

Does anyone know how to set up a date time axis to use DateTime Scale in a line graph in Telerik Reports? 有谁知道如何设置日期时间轴以在Telerik Reports的折线图中使用DateTime Scale? 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. 我有三列DATE,SALES_COUNT和SALES_TYPE。 I want there to be three lines on the graph. 我希望图表上有三条线。 One for each value of SALES_TYPE. 每个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. 我将SALES_TYPE用于该系列,将SALES_COUNT用于该值,并且由于我没有其他选择,因此我将DATE用于Category。 I clicked finish and previewed my graph. 我单击完成并预览了我的图形。 The graph looked right except I wanted to make a few customization to the DATE axis. 该图看起来不错,只不过我想对DATE轴进行一些自定义。 Specifically I only wanted it to write out a date label for every 5 ticks or so. 具体来说,我只希望它每隔5个滴答声写出一个日期标签。 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. 最终,我发现必须将轴设置为使用DateTime Scale,因为它默认为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. 我收到错误消息:“使用DateTimeScale,lineSeries1时X值不能为null或为空”,因此我转到lineSeries1并将X值设置为“ = Fields.DATE”,然后单击预览。 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. 现在,该图不再显示我的任何数据点,并且DateTime轴上只有一个刻度,其标记为1/1/2015 12:00:00 AM,这个DateTime甚至不在我的数据集中。 I have been struggling for over a week now to figure out how to do this simple task. 我一直在努力一个多星期,以找出如何完成此简单任务。 Please help me. 请帮我。

The SQL query I was using was handed to me by the DBA. 我正在使用的SQL查询是由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. 事实证明,查询将DATE列作为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. 一旦将DATE列转换为查询的选择列列表中的日期,将轴设置为使用DateTime Scale即可正常工作。 If anyone else runs into a similar problem, check the return types of your columns. 如果其他人遇到类似问题,请检查列的返回类型。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 带日期轴的ggplot垂直线 - ggplot vertical line with date axis MATLAB:在x轴上绘制日期的问题(折线图) - MATLAB: Problems with plotting dates on x-axis (line graph) 在 x 轴上具有双 y 轴刻度和日期时间的 Pandas 数据框的 Matplot 线图 - Matplot line graph of pandas dataframe with double y axis scale and datetime on x axis 在 geom_line() 图表中控制日期(x 轴)间隔 - Controlling date (x-axis) intervals in a geom_line() chart 在 r 中制作折线图时从日期时间中删除日期元素 - Remove date element from datetime while making line graph in r 使用散景绘制图形时,如何在 x_axis 类型为 datetime 时删除丢失的日期, - when plotting a graph using bokeh, how to remove missing date while x_axis type is datetime , 两个时间序列不会在同一x轴上绘制图形(日期格式问题)? - Two time series won't graph on same x axis (date format issue)? 从文本文件创建图形,其中轴X为日期,精度为毫秒,Y为值 - creating graph from text file where axis X is date with millisecond precision and Y is value 如何在 plotly.graph_objects.Heatmap 日期轴上选择刻度频率? - How to chose tick frequency on plotly.graph_objects.Heatmap date axis? 在telerik Grid中显示日期而不是DateTime - show date instead of DateTime in telerik Grid
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM