User (Legacy) Posted January 24, 2003 Report Share Posted January 24, 2003 Hi, I'm trying to capture the DblClk event, and then display more details to the user. I can capture the event, and grab the data alright, but the values that I'm trying to retreive are date values. When I use the following code, the values come back as like this: nINIValue=37578.333333333336 , nValue=37578.395833333336 but I'm looking for them to come back like this: nINIValue=11/18/2002 8:00:00 , nValue=11/18/2002 9:30:00. By the way, I'm doing this for a Gantt chart which is why I'm using the IniValue as well. Any idea of what I need to do? Do I just need to do a conversion with JavaScript? If so, what kind? Here's the client side JavaScript code I'm using. ---------------------------------------------------------------------------- -------------- <SCRIPT language="JavaScript" for="Chart" event="LButtonDblClk(x, y, nSerie, nPoint, nRes)"> <!-- try { var f = window.document.formContent; var numOfSuppliers = f.numOfSuppliers.value; var numOfMaxRackLiftings = f.numOfMaxRackLiftings.value; if ((nSerie != -1) && (nPoint != -1)){ //' Open the communications channel to get the value of the series/point var Chart = f.Chart; Chart.OpenDataEx(<%=COD_VALUES%>, numOfSuppliers, numOfMaxRackLiftings); Chart.OpenDataEX(<%=COD_INIVALUES%>, numOfSuppliers, numOfMaxRackLiftings); //Chart.ThisSerie=nSerie; nINIValue = f.Chart.IniValue(nPoint); nValue = f.Chart.Value(nPoint); //' Close the communications channel f.Chart.CloseData(1); alert(nINIValue + " " + nValue); } } catch(e) { alert(e.description); } Chart.ReturnValue = 1; //--> </SCRIPT> ---------------------------------------------------------------------------- -------------- Thanks for any help! Chad Link to comment Share on other sites More sharing options...
Software FX Posted January 24, 2003 Report Share Posted January 24, 2003 ChartFX is designed to handle numbers if both the X and Y axes. When dates are passed they are translated to numbers and kept internally as double precision numbers. When labels are shown they are translated back to date strings. In VBScript you could write CDate(dValue) and it would return you the date you expect. I am not sure if this possible in JavaScript but we will research into this. -- Regards, JC Software FX Support "Chad Lansford" <chartfx@shillglen.com> wrote in message news:Jf2jI#$wCHA.1384@webserver1.softwarefx.com... > Hi, > > I'm trying to capture the DblClk event, and then display more details to the > user. I can capture the event, and grab the data alright, but the values > that I'm trying to retreive are date values. When I use the following code, > the values come back as like this: nINIValue=37578.333333333336 , > nValue=37578.395833333336 but I'm looking for them to come back like this: > nINIValue=11/18/2002 8:00:00 , nValue=11/18/2002 9:30:00. By the way, I'm > doing this for a Gantt chart which is why I'm using the IniValue as well. > > Any idea of what I need to do? Do I just need to do a conversion with > JavaScript? If so, what kind? Here's the client side JavaScript code I'm > using. > > -------------------------------------------------------------------------- -- > -------------- > <SCRIPT language="JavaScript" for="Chart" event="LButtonDblClk(x, y, nSerie, > nPoint, nRes)"> > <!-- > try { > var f = window.document.formContent; > var numOfSuppliers = f.numOfSuppliers.value; > var numOfMaxRackLiftings = f.numOfMaxRackLiftings.value; > if ((nSerie != -1) && (nPoint != -1)){ > //' Open the communications channel to get the value of the series/point > var Chart = f.Chart; > Chart.OpenDataEx(<%=COD_VALUES%>, numOfSuppliers, numOfMaxRackLiftings); > Chart.OpenDataEX(<%=COD_INIVALUES%>, numOfSuppliers, > numOfMaxRackLiftings); > //Chart.ThisSerie=nSerie; > nINIValue = f.Chart.IniValue(nPoint); > nValue = f.Chart.Value(nPoint); > //' Close the communications channel > f.Chart.CloseData(1); > alert(nINIValue + " " + nValue); > } > } catch(e) { > alert(e.description); > } > Chart.ReturnValue = 1; > //--> > </SCRIPT> > -------------------------------------------------------------------------- -- > -------------- > > Thanks for any help! > Chad > > Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.