Aggiungi data e nome file in qualsiasi graficoMi chiedevo se qualcuno ha scritto un componente aggiuntivo o uno script che aggiunga la data corrente e il nome del file (della tabella dati di origine) a qualsiasi grafico/report generato?
Ho attivato le preferenze
Grazie
Condivisione e comunicazione dei risultatiRe: Aggiungere data e nome file in qualsiasi graficoNon è poi così semplice creare uno script che funzioni con qualsiasi grafico/report.
L'idea di base potrebbe essere qualcosa del genere, ma questo presuppone già che tu abbia un riferimento alla tabella e all'oggetto di analisi. Presuppone anche che tutti i framebox siano basati sulla stessa tabella
Names Default To Here(1);
dt = open("$SAMPLE_DATA/Big Class.jmp");
gb = dt << Graph Builder(
Variables(X(:weight), Y(:height), Overlay(:sex)),
Elements(Points(X, Y, Legend(9)), Line Of Fit(X, Y, Legend(11)))
);
str = Char(As Date(Today())) || " " || (dt << getname);
fbs = Report(gb) << XPath("//FrameBox");
Eval(EvalExpr(
fbs << Add Graphics Script(
Text Color("Red");
Text(Right Justified, {X Origin() + X Range(), Y Origin()}, Expr(str));
);
));
Ma capire, ad esempio, qual è la tabella corretta può diventare piuttosto complicato.
Re: Aggiungere data e nome file in qualsiasi graficoSenza i riferimenti alla tabella dati e al grafico, è possibile accedere all'oggetto gb tramite report / get scriptable object() e alla tabella dati tramite << get data table() .
Forse dovresti aggiungere del codice per saltare LDF e Column Switcher...
Names Default To Here(1);
/*
open("$SAMPLE_DATA/Big Class.jmp");
Graph Builder(
Variables(X(:weight), Y(:height), Overlay(:sex)),
Elements(Points(X, Y, Legend(9)), Line Of Fit(X, Y, Legend(11)))
);
*/
fbs = current report() << XPath("//FrameBox");
nfbs = N items(fbs); // add the info to the last FB
OBs= current report() << XPath("//OutlineBox");
gb = OBs[1] << get scriptable Object; // add some code to skip LDF and Column Switcher
str = Char(As Date(Today())) || " " || ((gb << get data table()) << getname);
Eval(EvalExpr(
fbs[nfbs] << Add Graphics Script(
Text Color("Red");
Text(Right Justified, {X Origin() + X Range(), Y Origin()}, Expr(str));
);
));Re: Aggiungere data e nome file in qualsiasi graficoBrillante - grazie