반응형

pyqtgraph -- timeaxis 만들어, 최근 data 만 실시간 보여주기




참고 : http://www.pyqtgraph.org/documentation/graphicsItems/axisitem.html#pyqtgraph.AxisItem.tickStrings

        https://gist.github.com/iverasp/9349dffa42aeffb32e48a0868edfa32d    --> 이를 바탕으로 소스 변경함. 

        https://stackoverflow.com/questions/31775468/show-string-values-on-x-axis-in-pyqtgraph   --> custom axis 만드느법

        https://gist.github.com/cpascual/cdcead6c166e63de2981bc23f5840a98

      




** AxisItem class 를 subclass 하여, 원하는 axis 만들수 있다. 

    --> 특히, tickStrings( ) 메소드를 override 하여, tick 에 원하는 양식으로 출력 변경가능하다.



** 최근 시간만 보여주기

  --> setData( ) 로 실시간 chart 그리기전에, setXRange( ) 이용하여, 최근 시간만 설정하면 ok!!!




<< 실행결과 >>




<< 소스 >>

--






반응형
Posted by 자유프로그램
,