PDA

View Full Version : X-Axis scaling



Jeff Kimmel
25-Jan-2013, 03:10 PM
All,

I have the report attached. What we get as default in DAI is that each data point is equi-distant apart from the other data points. In this report, though, the data points are time related & I would like them to be shown in a time-related way where if there were 3 hours between 2 data point it would be farther apart & if there were 5 minutes between data points they would be close together. Is there any way to make this happen?

Thanks,

Jeff

Bob Cergol
26-Jan-2013, 10:07 AM
Wow, that's quite a challenge Jeff.

Every chart type I have seen (yours is completely custom), defines evenly spaced points on the both axis. The data points on the graph elements then may display between, or on, those scale reference points. Whatever the solution is, I think it has to involve that the data for the X-axis is built on a value scale representing the total number of minutes relative to a minimum and maximum end-point. I'm thinking how Dataflex represents date values as an integer value with the oldest date starting with 1 (I think). Maybe you could use an SQL function to calculate the elapsed minutes between the date-time values .... not sure ....

I asked Cintac about this and am waiting on more suggestions but one suggestion was:
[Note to others: the ability to inject js via the rules tab into report design is in no way required for building sophisticated reporting and BI. It is just a capability to do really custom things and "push the envelope" as Jeff is doing.]

"It is something with datetime type x-axis."


xAxis: {
type: 'datetime',
maxZoom: 14 * 24 * 3600000, // fourteen days
title: {
text: null
}
},

Bob

Bo Andersen
28-Jan-2013, 06:07 AM
Hi Jeff,

if you email/post the page html source, we can give you a precise way, but as Bob / Carsten says, you need to tell highCharts that you want the X axis to be a date axis by setting the type to datetime. (see http://api.highcharts.com/highcharts#xAxis.type)

Here is an example:
http://jsfiddle.net/gh/get/jquery/1.7.2/highslide-software/highcharts.com/tree/master/samples/highcharts/xaxis/type-datetime-irregular/

Note that dates must be provided in milliseconds, so you may have to convert or use the Date.UTC(year,month,day,hours,minutes,seconds,mill isec) function

Dynamic AI has a chart type called HC Line (Dateline) that employs this chart type.

Let us know if that helps,

Best regards
Bo Andersen
CINTAC A/S


All,

I have the report attached. What we get as default in DAI is that each data point is equi-distant apart from the other data points. In this report, though, the data points are time related & I would like them to be shown in a time-related way where if there were 3 hours between 2 data point it would be farther apart & if there were 5 minutes between data points they would be close together. Is there any way to make this happen?

Thanks,

Jeff

Jeff Kimmel
28-Jan-2013, 10:28 AM
Bo,

I saw the DateTime bit but that didn't seem to work for me - when I Use that as the base for the report it only shows 1 data point so I'm not sure why that didn't do the trick. When you say post the html, what do you mean exactly (right click -> show frame source?) or the report-> view source?

Thanks,

Jeff

Bo Andersen
28-Jan-2013, 03:37 PM
Hi Jeff,

Frame source. Should have specified - sorry.

Best regards

Bo

Bob Cergol
28-Jan-2013, 05:20 PM
Hi Jeff,

Maybe it didn't work because you didn't do the value conversions as Bo mentioned ... ?

Here's an example using the HC date-line chart out-of-the box. The point of the example is it shows the date data points proportionally located between the date label points on the x axis. If the axis and your data were converted as Bo suggests maybe that would do the trick. (Easy for me to say so anyway :-)
6091
Bob

Jeff Kimmel
29-Jan-2013, 11:13 AM
Bob,

Thanks, I tried to convert using SQL but it didn't seem to do what I'd expect. I'm still looking into it.

Thanks,

Jeff

Jeff Kimmel
6-Feb-2013, 02:21 PM
Bo,

I thought I had sent this prior but it looks like I didn't as it's too long for the board. Is there an email where I can send it to you directly?

Thanks,

Jeff

Jeff Kimmel
6-Feb-2013, 02:34 PM
Bob,

I'm finally looking into this again & it turns out that the date-line that comes with DAI is ignoring the time portion. When i view source I see this:
Date.UTC(2013,0,10) for all my data points in the series. When I tried to run the report for the one day, all I got was 1 point. Do you know, can I use the Date.UTC(...) to define a column?

Thanks,

Jeff

Bob Cergol
8-Feb-2013, 10:58 PM
Hi Jeff,

Cintac has implemented a new chart type: Date-Time line chart that encodes the hour, minute and second in addition to the date. Let us know if that works for you.

6144

Bob

Jeff Kimmel
11-Feb-2013, 08:18 PM
Bob,

Indeed is confirmed as resolved. See screenshot, this is exactly what we wanted.

Thanks,

Jeff