Among other
Continuous values are binned and represented as ordinal values. [edited]
The only issue:
The axis and grid look a bit chaotic:
I'd prefer a more structured view like this one - with long divider and lower frame:
but the settings for Tick labels and grids:
... are missing in the GUI for Axis with Time Bin settings:
Why?
Have you made sure your columns are nominal/ordinal (I think tick labels are for categorical variables)?
You are right, besides being quite "ordinal", the values stay "continuous" - displayed on a continuous time scale.
I would say: tick labels are for continuous variables as well:
... but quite unfortunately, the cool tick label settings to adjust the graph are missing.
So, the only way it to manually change the modeling type to ordinal/nominal of the created transform column.
But then:
- I lose the Label row nesting functionality
At the moment, I think the only way is:
generate Year and month manually as ordinal values and then nest them on the x axis. [with issue (*)]
right?
It seems like that is the only option you currently have (I haven''t tried if you could force those by scripting).
For some seconds I thought that going via Time Bin could fix the issue with the too dynamic adjustment of the tick spacing in Graph builder: Heatmap - option: fixed Tick spacing (aggregation area) .
But clear: if it's just a transform column - and there is still the continuous axis scale, which is affected by the rescale bug.
An Issue (1):
The below code generates a graph like this:
Unfortunately the
Date Increment(., "Week", 0) = 01Jan0000;
ruins the scale on the x axis.
Open( "$SAMPLE_DATA/Aircraft Incidents.jmp" );
:Event Date[1] = .;
Graph Builder(
Transform Column(
"Week[Event Date]",
Format( "Format Pattern", "<MM></><DD></><YYYY>", 15 ),
Formula( Date Increment( :Event Date, "Week", 0 ) )
),
Variables( X( :"Week[Event Date]"n ) ),
Elements( Bar( X, Legend( 4 ) ) )
);
... so, one has to fix the formula manually via
If(is missing(:Event Date), ., Date Increment( :Event Date, "Week", 0 ))
If the user wants to bin by week - to get Plots for Year & week, there is another issue (#2):
by default, JMP creates the binned date with the format DD / MM / YYYY.
So, instead of week, still dates (with day and month) is used up as axis labels.
So, how to tell JMP that the week should be used.
Plan A:
- adjust the Format of the current axis - to use Week instead of day and month. and indeed, it works - but the user has to do the job for every single plot he wants to adjust.
Better:
The user can directy change the Format of the column (see code below) - then the week also gets into the axis labels:
even cooler: If the user enables nesting on the axis, JMP automatically shows the week AND the year - nested.
but wait - label nesting seems to have an issue with ISO Dates , Argh !!!
Why does the center plot show 2022 instead of 2023?!??!
Converting Week and Week2 to Format "Best" shows: both columns have the same entries. So, it's not an issue of the column, right?
New Table( "test",
Add Rows( 2 ),
Compress File When Saved( 1 ),
New Column( "date",
Format( "d/m/y", 10 ),
Set Values( [3768422400, 3797366400] )
),
New Column( "Week[date]",
Format( "Format Pattern", "<yyyy> cw<ww>", 15 ),
Formula( Date Increment( :date, "Week", 0 ) )
),
New Column( "Week[date]_2",
Format( "Format Pattern", "<DD>.<MM>.<YYYY>", 15 ),
Formula( Date Increment( :date, "Week", 0 ) )
)
);
Graph Builder(
Variables( X( :date ), X( :"Week[date]"n ),X( :"Week[date]_2"n ) ),
Elements( Position( 1, 1 ), Points( X ) ),
Elements( Position( 2, 1 ), Points( X ) ),
Elements( Position( 3, 1 ), Points( X ) ),
SendToReport(
Dispatch( {}, "date", ScaleBox, {Label Row Nesting( 2 )} ),
Dispatch( {}, "Week[date]", ScaleBox, {Label Row Nesting( 2 )} ),
Dispatch( {}, "Week[date]_2", ScaleBox, {Label Row Nesting( 2 )} )
)
);
-> some improvements + bugfixes for nested binned time/date axes