我正在尝试绘制具有以下属性的阶梯图: x 轴:时间(毫秒)[实际数据包含此作为双精度值] y 轴:存储为整数的另一个值。
我正在填充数据集,如下所示:
private XYSeries populateStepChartDataSet(HashMap<Double, Integer> dataGrid){
XYSeries xySeries = new XYSeries("Step Plot", true, true);
if(dataGrid != null){
for (Double timeStamp : dataGrid.keySet()) {
xySeries.add(timeStamp, dataGrid.get(timeStamp));
}
}
return xySeries;
}
我创建情节的部分如下:
final XYSeriesCollection dataset = new XYSeriesCollection();
dataset.addSeries(populateStepChartDataSet(dspDataGrid));
final JFreeChart chart = ChartFactory.createXYStepChart(
title,
xAxisLabel, yAxisLabel,
dataset,
PlotOrientation.VERTICAL,
true, // legend
true, // tooltips
false // urls
);
我期望的是该图在 x 轴上以毫秒为单位显示时间,但该值正在转换为一些奇怪的时间。这是情节的样子
有人可以帮我取回 x 轴的 ms 格式的时间戳吗?