EasyChart XTraceLabel with multiple pens


I’m having trouble with the getXTraceLabel function from the easyChart.
I have 2 kind of pens: one with usual float value, no problem with this one, and another which has some status (3 for now) and an associated message to put in the label. I pass through a dataset in the custom properties of the root to get the label and the date. The thing here is with self.selectedXValue, I only have the first pen date. I tried to get the closer date to the selectedXValue, but it’s not working well, especially when you have many values for the second between two of the first.

Here is how it looks like:

Any idea to get the right date value ? I’ld like to avoid using a subplot for now.

Thanks !

I’m pretty sure you’ll have to swap the order of your pens. If I recall correctly, the standard X-Trace locates off the first pen’s dataset. I rewrote the X-Trace functionality when I created the NoteChart Module – my NoteChart and EasyNoteChart components interpolate instead of jumping to a specific data point’s timestamp.

Just tried it, nothing change :confused:

I’m now tring to use the JFreeChart object in both configureChart and getXTraceLabel functions with CustomXYToolTipGenerator.

In the first one I’m stuck at chart.getXYPlot().getDataset(numDS).getItemCount(numSerie) which return 0. Note that I get the right pen name with chart.getXYPlot().getDataset(numDS).getSeriesKey(numSerie).

In the second one, the chart object itself returns none. That’s very strange.