1

I was using dynamic time chart.

Timeseries chart when the mouse is clicked I want to get the time value.

But the method I used was able to get the y-axis value.

How can I get the x-axis time?

Please help me.

code

chartComposite.addChartMouseListener(new ChartMouseListener() {

        @Override
        public void chartMouseMoved(ChartMouseEvent arg0) {

        }

        @Override
        public void chartMouseClicked(ChartMouseEvent event) {

            XYItemEntity entity = (XYItemEntity)event.getEntity();
            XYDataset dataset = entity.getDataset();

            int series = entity.getSeriesIndex();
            int item = entity.getItem();
            Comparable seriesKey = dataset.getSeriesKey(series);

            System.out.println(series + "   " + item + "    " + seriesKey);
        }
    });

1 Answers1

3

have you tried this?

Date date = new Date(dataset.getX(entity.getSeriesIndex(),entity.getItem()).longValue());
robthewolf
  • 7,343
  • 3
  • 29
  • 29