La variable de table est une chaîne de caractères, comme je l'ai déjà mentionné.Les valeurs JMP DateTime correspondent au nombre de secondes depuis le 1er janvier 1904. Ainsi, avant de pouvoir utiliser la variable de table, elle doit être convertie en une valeur DateTime.Dans le JSL ci-dessous, je choisis d'utiliser une fonction Informat () pour convertir la valeur.
Names Default To Here( 1 );
dt = New Table( "Example",
Add Rows( 355 ),
New Table Variable( "Reference Date", "07/15/2001" ),
New Column( "Event Date",
Format( "m/d/y", 12 ),
Input Format( "m/d/y" ),
Set Values(
[3061584000, 3061584000, 3061756800, 3061756800, 3062016000, 3062102400, 3062275200, 3062275200, 3062361600, 3062361600, 3062620800,
3062707200, 3062880000, 3062966400, 3063052800, 3063139200, 3063139200, 3063139200, 3063398400, 3063484800, 3063830400, 3064089600,
3064089600, 3064089600, 3064262400, 3064262400, 3064348800, 3064348800, 3064435200, 3064435200, 3064435200, 3064608000, 3064608000,
3064694400, 3064780800, 3064867200, 3064867200, 3064953600, 3065040000, 3065040000, 3065040000, 3065126400, 3065299200, 3065299200,
3065385600, 3065472000, 3065558400, 3065731200, 3065990400, 3066163200, 3066422400, 3066681600, 3066854400, 3066940800, 3066940800,
3066940800, 3067027200, 3067200000, 3067804800, 3067891200, 3067891200, 3068064000, 3068236800, 3068409600, 3068582400, 3068668800,
3068755200, 3068841600, 3068841600, 3068841600, 3068928000, 3069014400, 3069014400, 3069360000, 3069446400, 3069532800, 3069619200,
3069619200, 3069705600, 3069705600, 3069705600, 3069878400, 3070051200, 3070051200, 3070310400, 3070310400, 3070396800, 3070483200,
3070742400, 3070742400, 3070742400, 3070915200, 3071088000, 3071174400, 3071260800, 3071260800, 3071433600, 3071433600, 3071520000,
3071865600, 3071952000, 3071952000, 3072384000, 3072384000, 3072470400, 3072470400, 3072556800, 3072556800, 3072556800, 3072643200,
3072643200, 3072729600, 3072816000, 3072988800, 3073075200, 3073248000, 3073334400, 3073334400, 3073334400, 3073507200, 3073507200,
3073680000, 3073680000, 3073766400, 3073766400, 3073766400, 3073852800, 3073852800, 3073852800, 3073939200, 3074284800, 3074284800,
3074371200, 3074371200, 3074371200, 3074371200, 3074371200, 3074371200, 3074457600, 3074630400, 3074630400, 3074716800, 3074976000,
3074976000, 3075062400, 3075235200, 3075321600, 3075321600, 3075408000, 3075494400, 3075494400, 3075494400, 3075494400, 3075494400,
3075494400, 3075494400, 3075667200, 3075926400, 3075926400, 3076012800, 3076099200, 3076185600, 3076185600, 3076272000, 3076272000,
3076272000, 3076876800, 3076876800, 3076963200, 3077222400, 3077308800, 3077308800, 3077568000, 3077568000, 3077654400, 3077654400,
3077740800, 3077827200, 3077827200, 3077913600, 3077913600, 3078000000, 3078000000, 3078172800, 3078259200, 3078345600, 3078432000,
3078518400, 3078518400, 3078518400, 3078518400, 3078518400, 3078604800, 3078604800, 3078691200, 3078777600, 3078777600, 3078777600,
3078950400, 3078950400, 3078950400, 3079123200, 3079123200, 3079123200, 3079123200, 3079123200, 3079209600, 3079296000, 3079296000,
3079382400, 3079382400, 3079468800, 3079468800, 3079641600, 3079728000, 3079728000, 3079814400, 3079814400, 3079814400, 3080160000,
3080160000, 3080246400, 3080246400, 3080332800, 3080332800, 3080419200, 3080419200, 3080505600, 3080592000, 3080678400, 3080851200,
3081024000, 3081024000, 3081024000, 3081196800, 3081283200, 3081283200, 3081369600, 3081369600, 3081369600, 3081456000, 3081456000,
3081456000, 3081456000, 3081542400, 3081628800, 3081715200, 3081715200, 3081715200, 3081715200, 3081888000, 3081974400, 3082060800,
3082060800, 3082060800, 3082492800, 3082492800, 3082492800, 3082492800, 3082752000, 3082838400, 3082838400, 3082838400, 3082924800,
3083011200, 3083011200, 3083011200, 3083011200, 3083270400, 3083443200, 3083961600, 3084134400, 3084134400, 3084220800, 3084480000,
3084566400, 3084566400, 3084739200, 3084912000, 3084912000, 3084998400, 3084998400, 3085084800, 3085257600, 3085516800, 3085516800,
3085776000, 3086035200, 3086035200, 3086208000, 3086208000, 3086294400, 3086294400, 3086380800, 3086467200, 3086467200, 3086553600,
3086553600, 3086553600, 3086553600, 3086640000, 3086985600, 3087072000, 3087244800, 3087244800, 3087331200, 3087590400, 3087590400,
3087590400, 3087676800, 3087676800, 3087763200, 3087936000, 3088022400, 3088195200, 3088281600, 3088368000, 3088368000, 3088368000,
3088454400, 3088540800, 3088627200, 3088713600, 3088713600, 3088886400, 3088972800, 3089145600, 3089145600, 3089232000, 3089232000,
3089232000, 3089232000, 3089664000, 3090009600, 3090096000, 3090268800, 3090355200, 3090528000, 3090700800, 3090700800, 3090700800,
3090787200, 3090873600, 3090960000, 3090960000, 3090960000, 3090960000, 3091132800, 3092083200, 3092256000, 3092342400, 3092428800,
3092428800, 3092515200, 3092601600]
)
),
New Column( "Total Fatal Injuries",
Set Values(
[2, 0, 1, 1, 1, 2, 9, 2, 1, 1, 2, 0, 2, 1, 2, 4, 2, 2, 10, 1, 2, 2, 2, 2, 2, 2, 1, 1, 0, 2, 1, 1, 2, 2, 2, 5, 2, 4, 2, 4, 4, 1, 3, 4, 3,
1, 2, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 4, 1, 1, 2, 2, 1, 1, 3, 18, 1, 1, 1, 1, 2, 1, 1, 2, 2, 2, 2, 1, 3, 1, 2, 1, 1, 1, 1, 1, 1, 4, 2, 1, 1,
2, 1, 1, 1, 2, 1, 1, 2, 1, 2, 1, 2, 2, 1, 1, 4, 1, 2, 1, 2, 1, 1, 2, 1, 3, 1, 2, 1, 2, 2, 1, 1, 1, 1, 1, 3, 3, 1, 4, 2, 2, 1, 3, 1, 1, 1,
5, 1, 1, 3, 1, 2, 2, 3, 1, 1, 2, 1, 2, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 1, 2, 6, 1, 1, 1, 4, 1,
1, 3, 1, 2, 2, 2, 2, 1, 1, 2, 3, 1, 2, 1, 1, 1, 1, 1, 4, 2, 1, 1, 1, 6, 6, 1, 2, 2, 2, 1, 1, 2, 2, 1, 1, 2, 1, 2, 1, 6, 3, 2, 1, 2, 1, 2,
2, 2, 3, 3, 1, 1, 1, 1, 1, 2, 1, 1, 2, 2, 1, 1, 2, 1, 2, 2, 1, 1, 3, 1, 1, 3, 1, 1, 1, 3, 2, 1, 2, 1, 1, 92, 65, 64, 44, 1, 1, 1, 2, 1, 1,
1, 3, 1, 1, 1, 3, 2, 1, 2, 1, 10, 1, 1, 2, 2, 3, 3, 2, 1, 1, 1, 1, 2, 1, 2, 1, 1, 1, 2, 1, 2, 1, 3, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2, 265, 4,
2, 1, 2, 1, 1, 1, 1, 5, 1, 1, 2, 2, 2, 2, 2, 4, 1, 2, 1, 4, 2, 1, 2, 2, 3, 1, 3, 4, 1, 2, 3, 2, 1, 1, 1, 1]
)
)
);
gb = Graph Builder(
Size( 531, 464 ),
Show Control Panel( 0 ),
Variables( X( :Event Date ), Y( :Total Fatal Injuries ) ),
Elements( Points( X, Y, Legend( 5 ) ) ),
SendToReport(
Dispatch(
{},
"Event Date",
ScaleBox,
{Min( 3059894016 ), Max( 3093859584 ), Interval( "Month" ), Inc( 1 ),
Minor Ticks( 1 ), Label Row( Label Orientation( "Angled" ) )}
),
Dispatch(
{},
"Total Fatal Injuries",
ScaleBox,
{Format( "Best", 10 ), Min( -0.147373575211003 ),
Max( 11.0505783676065 ), Inc( 2.5 ), Minor Ticks( 0 )}
)
)
);
gbr = gb << report;
refDate =informat(:Reference Date, "m/d/y");
gbr[axisbox(1)] << add ref line( refDate );