日付<->人間が読める形式
Datejsはこれに適しています。例えば:
var date = Date.parse('February 20th 1973');
var date = Date.parse('next thursday');
// Now let's convert a date into a human-readable string
var dateString = date.toString('dddd, MMMM d, yyyy');
日付<->jqPlotタイムスタンプ
jqPlotで内部的に使用されるタイムスタンプは、ミリ秒単位のUnix時間です。
var exampleTimestamp = 1345671839000;
var date = new Date(exampleTimestamp);
// Now let's convert a date into a timestamp
var jqPlotTimestamp = date.getTime();
日付<->x座標(ピクセル単位)
x軸が線形であると仮定すると、次のようにx軸上の点の値を決定できます(独自の値を入力します)。
var myPlot = jqplot(...);
var xAxis = myPlot.axes.xaxis;
var MARGIN_LEFT = 15; // Pixels from [left edge of chart --> minimum X value]
var pixelRange = 300; // Pixels from [min X value --> max X value]
var timeRange = xAxis.max - xAxis.min;
var time; // This will be our answer in the chart's units
time = xAxis.min + timeRange * (xCoordinate - MARGIN_LEFT) / pixelRange;
var timeInMillis = ... ; // Convert the X-Axis unit of time into millis
var date = new Date(timeInMillis);
// Now let's convert a date into an x coordinate
timeInMillis = date.getTime();
time = ...; // Convert millis into X-Axis unit of time
var x = MARGIN_LEFT + pixelRange * (time - xAxis.min) / timeRange;
この投稿を書いている時点で、軸名のリストは次のとおりです。
['yMidAxis', 'xaxis', 'yaxis', 'x2axis', 'y2axis', 'y3axis', 'y4axis', 'y5axis', 'y6axis', 'y7axis', 'y8axis', 'y9axis'];