I need your help to find where is the problem why I can't see the curves, here is my code :

I think I need to refresh something, but don't know what, and what is weird is when I add new series to the graph that display a plot, if not I can't see the old one?

I put all my code for this part, because, I have some other small problems as, how to display an empty area with QChart and the best way to display points and the curve in same time, in an esthetic and fast way.

Qt Code:
  1. class chartClass(QChart):
  2. [INDENT][INDENT]def __init__(self, params):
  3. super().__init__()
  4.  
  5. #init with params
  6.  
  7. self.allCruvs = []
  8. self.allCruvs.append(QLineSeries(self))
  9. self.addSeries(self.allCruvs[-1])
  10.  
  11.  
  12. def plotData(self, Time, Values, color=None, curvIndex=0):
  13.  
  14. #test new curv or clear the old one
  15. if (curvIndex < len(self.allCruvs)):
  16. self.allCruvs[curvIndex].clear()
  17. else:
  18. curvIndex = len(self.allCruvs)
  19. self.allCruvs.append(QLineSeries(self))
  20. self.addSeries(self.allCruvs[-1])
  21.  
  22. # Get max and min for time axe and title
  23. self.myZero = min(Time)
  24. self.myMax = max(Time)
  25.  
  26. # define title
  27. dateFormat = '%m/%d %H:%M'
  28. myZeroSTR = datetime.datetime.fromtimestamp(int(self.myZero)).strftime(dateFormat)
  29. myMaxSTR = datetime.datetime.fromtimestamp(int(self.myMax)).strftime(dateFormat)
  30. self.allCruvs[-1].setName(self.type + " [ " + myZeroSTR + " - " + myMaxSTR + " ]")
  31.  
  32. # define number of ticks // still in prehistoric way to do automatic new one
  33. maxDelta = round(max(Time) - self.myZero, 0)
  34. if (maxDelta < 20):
  35. self.ticks = maxDelta + 1
  36. elif maxDelta > 20:
  37. self.ticks = int(maxDelta / 10) + 2
  38. elif maxDelta > 200:
  39. self.ticks = int(maxDelta / 100) + 2
  40. elif maxDelta > 2000:
  41. self.ticks = int(maxDelta / 1000) + 2
  42. elif maxDelta > 20000:
  43. self.ticks = int(maxDelta / 10000) + 2
  44.  
  45. # Set axis ticks and min/max
  46. self.xAxe.setTickCount(self.ticks)
  47. self.xAxe.setRange(0, maxDelta)
  48. self.yAxe.setRange(min(Values), max(Values))
  49.  
  50. # set Pen and brush // need to plot line and the points with it
  51. pen = QtGui.QPen()
  52. brush = QtGui.QBrush()
  53.  
  54. pen.setWidthF(PENSIZE)
  55. # pen.setWidthF(3)
  56. pen.setCapStyle(Qt.RoundCap)
  57. pen.setJoinStyle(Qt.RoundJoin)
  58. # pen.setStyle(QtCore.Qt.NoPen)
  59. # pen.setStyle(QtCore.Qt.SolidLine)
  60.  
  61. myColor = color
  62. if color is None:
  63. self.grColor += 1
  64. self.grColor %= len(self.myPalette)
  65. myColor = self.colorByIndex()
  66.  
  67. pen.setColor(myColor)
  68. brush.setColor(myColor)
  69. self.allCruvs[-1].setPointsVisible(True)
  70.  
  71. self.allCruvs[-1].setPen(pen)
  72. pen.setBrush(brush)
  73. self.allCruvs[-1].setBrush(brush)
  74.  
  75. lastTime = self.myZero
  76. for i, theTime in enumerate(Time):
  77. if (theTime > lastTime + MININTERVALTIME):
  78. # Best thing to do is to plot an empty field, but couldn't do it so I plot an horizontal line for now
  79. self.allCruvs[-1].append(lastTime - self.myZero, Values[i])
  80.  
  81. self.allCruvs[-1].append(theTime - self.myZero, Values[i])
  82. lastTime = theTime
  83.  
  84.  
  85. # when I add this part it plots the line but without points
  86. try:
  87. self.addSeries(self.allCruvs[-1])
  88.  
  89. # when I comment this part it does not plot the curv at all
  90. #try:
  91. # self.addSeries(self.allCruvs[-1])
  92.  
  93. # With this test I know that curvs exists and are in visible mode but nothing is shown on the screen
  94. for curv in self.series():
  95. print("self.allCruvs[] : ", len(curv), "is visible : ", curv.isVisible())
  96.  
  97. # curv.show() # do nothing new I can see
  98.  
  99. #self.show() # do nothing new I can see[/INDENT][/INDENT]
To copy to clipboard, switch view to plain text mode 

Thanks in advance