Commit 9ab47bf7 authored by Valentin Valls's avatar Valentin Valls
Browse files

Make sure the curve tooltip is working with many scans

parent c68ba64c
...@@ -825,6 +825,7 @@ class CurvePlotWidget(plot_helper.PlotWidget): ...@@ -825,6 +825,7 @@ class CurvePlotWidget(plot_helper.PlotWidget):
style = item.getStyle(scan) style = item.getStyle(scan)
curveItem = plot_helper.FlintCurve() curveItem = plot_helper.FlintCurve()
curveItem.setCustomItem(item) curveItem.setCustomItem(item)
curveItem.setScan(scan)
curveItem.setData(x=xx, y=yy, copy=False) curveItem.setData(x=xx, y=yy, copy=False)
curveItem.setName(legend) curveItem.setName(legend)
curveItem.setLineStyle(style.lineStyle) curveItem.setLineStyle(style.lineStyle)
......
...@@ -481,6 +481,8 @@ class FlintItemMixIn: ...@@ -481,6 +481,8 @@ class FlintItemMixIn:
def _getColoredSymbol(self, flintModel, scan: scan_model.Scan): def _getColoredSymbol(self, flintModel, scan: scan_model.Scan):
"""Returns a colored HTML char according to the expected plot item style """Returns a colored HTML char according to the expected plot item style
""" """
if scan is None:
scan = self.__scan
plotItem = self.customItem() plotItem = self.customItem()
if plotItem is not None: if plotItem is not None:
style = plotItem.getStyle(scan) style = plotItem.getStyle(scan)
...@@ -560,7 +562,7 @@ class FlintCurve(Curve, FlintItemMixIn): ...@@ -560,7 +562,7 @@ class FlintCurve(Curve, FlintItemMixIn):
xName = "X" xName = "X"
yName = "Y" yName = "Y"
char = self._getColoredSymbol(flintModel, scan) char = self._getColoredSymbol(flintModel, None)
text = f""" text = f"""
<li style="white-space:pre">{char} <b>{yName}:</b> {yValue} (index {index})</li> <li style="white-space:pre">{char} <b>{yName}:</b> {yValue} (index {index})</li>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment