使用QTableWidget訂閱商品報價(1) | 將訂閱商品資訊填入QtTableWidget
結論: 修改了Part V. 第670行後, 即搞定
MyMainWindow():
1. 選擇訂閱的商品:
twQueryStock()
第670行
MyMainWindow():
2. 訂閱商品報價回傳:
第500行
●FB https://www.facebook.com/groups/248705245950294 ●YT https://www.youtube.com/channel/UCTcXwTLJM62hYzCAQ6fA5tg ●FB粉絲團: https://m.facebook.com/00bnf/ ●東京交易故事(電子書/影音): 東京交易故事1-BNF交易手法解說1 東京交易故事2-BNF交易手法解說2 東京交易故事3-BNF交易手法解說3 東京交易故事4-日本股神CIS-1 東京交易故事5-日本股神CIS-6 東京交易故事6-BNF自己流1-3 東京交易故事7-秒速億元男的哲學1 東京交易故事8-秒速億元男的交易手法和BNF的交易哲學 東京交易故事9-TW自己流1 東京交易故事10-秒速億元男的交易手法2 東京交易故事11-TW自己流2(選擇權的波動交易策略) 東京交易故事12-TW自己流3(綜合實戰策略: 選擇權+現貨對沖) 合図【あいず】信號,暗號 #cis #股神 #BNF #逆勢接刀 #短線交易 #日本股神bnf研究會
使用QTableWidget訂閱商品報價(1) | 將訂閱商品資訊填入QtTableWidget
結論: 修改了Part V. 第670行後, 即搞定
MyMainWindow():
1. 選擇訂閱的商品:
twQueryStock()
第670行
MyMainWindow():
2. 訂閱商品報價回傳:
第500行
結論:
1.點選右側styleSheet
2.直接輸入CSS語法: background-color:rgb(255, 170, 255)
1. 參考資料
均線Color設定:
先說結論: pg.plot(xdata, ydata, pen='r')
1. 參考資訊1:
https://www.geeksforgeeks.org/pyqtgraph-setting-pen-of-line-in-line-graph/
# method for components def UiComponents(self): # creating a widget object widget = QWidget() # creating a new label label = QLabel("GeeksforGeeks Line Plot") # making it multiline label.setWordWrap(True) # y values to plot by line 1 y = [2, 8, 6, 8, 6, 11, 14, 13, 18, 19] # y values to plot by line 2 y2 = [3, 1, 5, 8, 9, 11, 16, 17, 14, 16] x = range(0, 10) # create plot window object plt = pg.plot() # showing x and y grids plt.showGrid(x = True, y = True) # adding legend plt.addLegend() # set properties of the label for y axis plt.setLabel('left', 'Vertical Values', units ='y') # set properties of the label for x axis plt.setLabel('bottom', 'Horizontal Values', units ='s') # setting horizontal range plt.setXRange(0, 10) # setting vertical range plt.setYRange(0, 20) # plotting line in green color # with dot symbol as x, not a mandatory field line1 = plt.plot(x, y, pen ='g', symbol ='x', symbolPen ='g', symbolBrush = 0.2, name ='green') # plotting line2 with blue color # with dot symbol as o line2 = plt.plot(x, y2, pen ='b', symbol ='o', symbolPen ='b', symbolBrush = 0.2, name ='blue') # setting pen of the line 1 line1.setPen(QColor(168, 34, 3))
2. 參考資訊2:
Line, Fill, and Color
Qt relies on its QColor, QPen and QBrush classes for specifying line and fill styles for all of its drawing.
Internally, pyqtgraph uses the same system but also allows many shorthand methods of specifying the same style options.
Many functions and methods in pyqtgraph accept arguments specifying the line style (pen), fill style (brush), or color. For most of these function arguments, the following values may be used:
single-character string representing color (b, g, r, c, m, y, k, w)
(r, g, b) or (r, g, b, a) tuple
single greyscale value (0.0 - 1.0)
(index, maximum) tuple for automatically iterating through colors (see intColor)
QColor
QPen / QBrush where appropriate
Notably, more complex pens and brushes can be easily built using the mkPen() / mkBrush() functions or with Qt’s QPen and QBrush classes:
mkPen('y', width=3, style=QtCore.Qt.DashLine) ## Make a dashed yellow line 2px wide
mkPen(0.5) ## solid grey line 1px wide
mkPen(color=(200, 200, 255), style=QtCore.Qt.DotLine) ## Dotted pale-blue line
See the Qt documentation for ‘QPen’ and ‘PenStyle’ for more line-style options and ‘QBrush’ for more fill options. Colors can also be built using mkColor(), intColor(), hsvColor(), or Qt’s QColor class.
Default Background and Foreground Colors
By default, pyqtgraph uses a black background for its plots and grey for axes, text, and plot lines. These defaults can be changed using pyqtgraph.setConfigOption():
import pyqtgraph as pg
## Switch to using white background and black foreground
pg.setConfigOption('background', 'w')
pg.setConfigOption('foreground', 'k')
## The following plot has inverted colors
pg.plot([1,4,2,3,5])
(Note that this must be set before creating any widgets)
3. 參考資訊3:
https://www.geeksforgeeks.org/pyqtgraph-setting-background-of-plot-window/# create pyqt5graph bar graph item # with width = 0.6# with bar colors = greenbargraph1 = pg.BarGraphItem(x = x, height = y1, width = 0.6, brush ='g') # add item to plot window# adding bargraph item to the windowwindow.addItem(bargraph1) # setting plot window background color to yellowwindow.setBackground('y')
4. 參考資訊4: (成功)https://pyqtgraph.readthedocs.io/en/latest/api_reference/functions.html#pyqtgraph.mkPenColor, Pen, and Brush Functions
Qt uses the classes QColor, QPen, and QBrush to determine how to draw lines and fill shapes. These classes are highly capable but somewhat awkward to use. PyQtGraph offers the functions mkColor(), mkPen(), and mkBrush() to simplify the process of creating these classes. In most cases, however, it will be unnecessary to call these functions directly–any function or method that accepts pen or brush arguments will make use of these functions for you.
For example, the following three lines all have the same effect:
test test1 Written with StackEdit .