久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

    <bdo id='QMIM0'></bdo><ul id='QMIM0'></ul>
  • <small id='QMIM0'></small><noframes id='QMIM0'>

  • <i id='QMIM0'><tr id='QMIM0'><dt id='QMIM0'><q id='QMIM0'><span id='QMIM0'><b id='QMIM0'><form id='QMIM0'><ins id='QMIM0'></ins><ul id='QMIM0'></ul><sub id='QMIM0'></sub></form><legend id='QMIM0'></legend><bdo id='QMIM0'><pre id='QMIM0'><center id='QMIM0'></center></pre></bdo></b><th id='QMIM0'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='QMIM0'><tfoot id='QMIM0'></tfoot><dl id='QMIM0'><fieldset id='QMIM0'></fieldset></dl></div>
    1. <tfoot id='QMIM0'></tfoot>

      1. <legend id='QMIM0'><style id='QMIM0'><dir id='QMIM0'><q id='QMIM0'></q></dir></style></legend>
      2. 在同一 qtchart 上繪制燭臺和 5 天平均線,但給出

        plot candlestick and 5-days average line on a same qtchart but give two x axis plot(在同一 qtchart 上繪制燭臺和 5 天平均線,但給出兩個 x 軸圖)

            1. <i id='Xw3SJ'><tr id='Xw3SJ'><dt id='Xw3SJ'><q id='Xw3SJ'><span id='Xw3SJ'><b id='Xw3SJ'><form id='Xw3SJ'><ins id='Xw3SJ'></ins><ul id='Xw3SJ'></ul><sub id='Xw3SJ'></sub></form><legend id='Xw3SJ'></legend><bdo id='Xw3SJ'><pre id='Xw3SJ'><center id='Xw3SJ'></center></pre></bdo></b><th id='Xw3SJ'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='Xw3SJ'><tfoot id='Xw3SJ'></tfoot><dl id='Xw3SJ'><fieldset id='Xw3SJ'></fieldset></dl></div>
            2. <legend id='Xw3SJ'><style id='Xw3SJ'><dir id='Xw3SJ'><q id='Xw3SJ'></q></dir></style></legend>

                  <tbody id='Xw3SJ'></tbody>
                <tfoot id='Xw3SJ'></tfoot>
                • <bdo id='Xw3SJ'></bdo><ul id='Xw3SJ'></ul>

                  <small id='Xw3SJ'></small><noframes id='Xw3SJ'>

                • 本文介紹了在同一 qtchart 上繪制燭臺和 5 天平均線,但給出兩個 x 軸圖的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我想在同一個 qchart 上繪制燭臺和 5 天平均線,它應該顯示 一個 x 軸,但給出 兩個 x 軸.這是代碼和情節.

                  導入系統從 PyQt5.QtChart 導入(QCandlestickSeries、QChart、QChartView)從 PyQt5.QtWidgets 導入 QApplication、QMainWindow從 PyQt5.QtCore 導入 Qt從 PyQt5 導入 QtChart 作為 qc"""要加載的數據如下所示:num, 打開, 高, 低, 關閉, ma51 7380 7520 7380 7510 73242 7520 7580 7410 7440 73723 7440 7650 7310 7520 74344 7450 7640 7450 7550 74805 7510 7590 7460 7490 75026 7500 7590 7480 7560 75127 7560 7830 7540 7800 7584……"""應用程序 = QApplication(sys.argv)#系列 = QCandlestickSeries()series.setDncreasingColor(Qt.red)series.setIecreasingColor(Qt.green)ma5 = qc.QLineSeries() # 5天平均數據線candle_x_axis_label = [] # 存儲str類型數據# 在一個循環中,series 和 ma5 追加對應的數據對于數據中的 num、o、h、l、c、m:series.append(QCandlestickSet(o, h, l, c))ma5.append(m)蠟燭x軸標簽附加(str(num))圖表 = QChart()chart.addSeries(series) # 蠟燭圖chart.addSeries(ma5) # ma5 線chart.setAnimationOptions(QChart.SeriesAnimations)chart.createDefaultAxes()chart.legend().hide()# 這里是重點# tm 是 str 列表,就像 '1, 2, 3, ..., n'chart.axes(Qt.Horizo??ntal)[0].setCategories(candle_x_axis_label)#chartview = QChartView(圖表)ui = QMainWindow()ui.setGeometry(50, 50, 500, 300)ui.setCentralWidget(圖表視圖)ui.show()sys.exit(app.exec_())

                  和劇情

                  我查看qtchart代碼,發現燭臺x軸的類類型是QBarCategoryAxis,而ma5 x軸的類類型是QValueAxis.那么如何去除兩個x軸呢?

                  解決方案

                  你只需要獲取QLineSeries的X軸對應的QAbstractAxis并用

                  I want to plot candlestick and 5-days average line on the same qchart, it should show one x axis, but gives two x axis. here is the code and the plot.

                  import sys
                  from PyQt5.QtChart import (QCandlestickSeries, QChart, QChartView)
                  from PyQt5.QtWidgets import QApplication, QMainWindow
                  from PyQt5.QtCore import Qt
                  from PyQt5 import QtChart as qc
                  
                  """
                  data to be load just like the following:
                  
                  num, open, high, low, close, ma5
                  1    7380  7520  7380 7510   7324 
                  2    7520  7580  7410 7440   7372
                  3    7440  7650  7310 7520   7434
                  4    7450  7640  7450 7550   7480
                  5    7510  7590  7460 7490   7502
                  6    7500  7590  7480 7560   7512
                  7    7560  7830  7540 7800   7584
                  ... ...
                  """
                  
                  app = QApplication(sys.argv)
                  #
                  series = QCandlestickSeries()
                  series.setDncreasingColor(Qt.red)
                  series.setIecreasingColor(Qt.green)
                  
                  ma5 = qc.QLineSeries()  # 5-days average data line
                  candle_x_axis_label = []  # stores str type data
                  
                  # in a loop,  series and ma5 append corresponding data
                  for num, o, h, l, c, m in data:
                      series.append(QCandlestickSet(o, h, l, c))
                      ma5.append(m)
                      candle_x_axis_label.append(str(num))
                  
                  chart = QChart()
                  
                  chart.addSeries(series)  # candle
                  chart.addSeries(ma5)  # ma5 line
                  
                  chart.setAnimationOptions(QChart.SeriesAnimations)
                  chart.createDefaultAxes()
                  chart.legend().hide()
                  
                  # here is the point
                  # tm is str list, just like '1, 2, 3, ..., n'
                  chart.axes(Qt.Horizontal)[0].setCategories(candle_x_axis_label)
                  
                  #
                  chartview = QChartView(chart)
                  ui = QMainWindow()
                  ui.setGeometry(50, 50, 500, 300)
                  ui.setCentralWidget(chartview)
                  ui.show()
                  sys.exit(app.exec_())
                  

                  and the plot

                  i check qtchart code, and find out the class type of candlestick x axis is QBarCategoryAxis but the class type of ma5 x axis is QValueAxis. so how to remove of the two x axis?

                  解決方案

                  You only have to obtain the QAbstractAxis corresponding to the X axis of the QLineSeries and hide it with setVisible(False), for this you must use QChart::axisX():

                  chart.axisX(ma5).setVisible(False)
                  

                  Complete Code:

                  import sys
                  from PyQt5.QtChart import QCandlestickSeries, QChart, QChartView, QCandlestickSet
                  from PyQt5.QtWidgets import QApplication, QMainWindow
                  from PyQt5.QtCore import Qt, QPointF
                  from PyQt5 import QtChart as qc
                  
                  data = ((1, 7380, 7520, 7380, 7510, 7324), 
                      (2, 7520, 7580, 7410, 7440, 7372),
                      (3, 7440, 7650, 7310, 7520, 7434),
                      (4, 7450, 7640, 7450, 7550, 7480),
                      (5, 7510, 7590, 7460, 7490, 7502),
                      (6, 7500, 7590, 7480, 7560, 7512),
                      (7, 7560, 7830, 7540, 7800, 7584))
                  
                  
                  app = QApplication(sys.argv)
                  #
                  series = QCandlestickSeries()
                  series.setDecreasingColor(Qt.red)
                  series.setIncreasingColor(Qt.green)
                  
                  ma5 = qc.QLineSeries()  # 5-days average data line
                  tm = []  # stores str type data
                  
                  # in a loop,  series and ma5 append corresponding data
                  for num, o, h, l, c, m in data:
                      series.append(QCandlestickSet(o, h, l, c))
                      ma5.append(QPointF(num, m))
                      tm.append(str(num))
                  
                  chart = QChart()
                  
                  chart.addSeries(series)  # candle
                  chart.addSeries(ma5)  # ma5 line
                  
                  chart.setAnimationOptions(QChart.SeriesAnimations)
                  chart.createDefaultAxes()
                  chart.legend().hide()
                  
                  chart.axisX(series).setCategories(tm)
                  chart.axisX(ma5).setVisible(False)
                  
                  chartview = QChartView(chart)
                  ui = QMainWindow()
                  ui.setGeometry(50, 50, 500, 300)
                  ui.setCentralWidget(chartview)
                  ui.show()
                  sys.exit(app.exec_())
                  

                  這篇關于在同一 qtchart 上繪制燭臺和 5 天平均線,但給出兩個 x 軸圖的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  How to bind a function to an Action from Qt menubar?(如何將函數綁定到 Qt 菜單欄中的操作?)
                  PyQt progress jumps to 100% after it starts(PyQt 啟動后進度躍升至 100%)
                  How to set yaxis tick label in a fixed position so that when i scroll left or right the yaxis tick label should be visible?(如何將 yaxis 刻度標簽設置在固定位置,以便當我向左或向右滾動時,yaxis 刻度標簽應該可見
                  `QImage` constructor has unknown keyword `data`(`QImage` 構造函數有未知關鍵字 `data`)
                  Change x-axis ticks to custom strings(將 x 軸刻度更改為自定義字符串)
                  How to show progress bar while saving file to excel in python?(如何在python中將文件保存為excel時顯示進度條?)

                    <i id='wnZMo'><tr id='wnZMo'><dt id='wnZMo'><q id='wnZMo'><span id='wnZMo'><b id='wnZMo'><form id='wnZMo'><ins id='wnZMo'></ins><ul id='wnZMo'></ul><sub id='wnZMo'></sub></form><legend id='wnZMo'></legend><bdo id='wnZMo'><pre id='wnZMo'><center id='wnZMo'></center></pre></bdo></b><th id='wnZMo'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='wnZMo'><tfoot id='wnZMo'></tfoot><dl id='wnZMo'><fieldset id='wnZMo'></fieldset></dl></div>
                      <tfoot id='wnZMo'></tfoot>

                      • <legend id='wnZMo'><style id='wnZMo'><dir id='wnZMo'><q id='wnZMo'></q></dir></style></legend>
                          <bdo id='wnZMo'></bdo><ul id='wnZMo'></ul>
                        • <small id='wnZMo'></small><noframes id='wnZMo'>

                              <tbody id='wnZMo'></tbody>

                            主站蜘蛛池模板: 国产免费又色又爽又黄在线观看 | 久久久精品网 | 日韩高清中文字幕 | 久久aⅴ乱码一区二区三区 91综合网 | 成人免费在线小视频 | 国产偷自视频区视频 | 99资源站| 九九视频网 | 日韩欧美综合在线视频 | 国产韩国精品一区二区三区 | 视频在线观看一区二区 | 成人午夜网站 | 成人一区二区在线 | 国产免费视频在线 | 精品久久久久久亚洲综合网 | 麻豆久久久9性大片 | 亚洲欧美视频一区 | 久久专区 | 久久久久国产一区二区三区 | 天堂在线1 | 久久久久久国产免费视网址 | 国产精品一区二区三区在线播放 | 久久机热 | 久久成人午夜 | 美女黄网站 | 亚洲一区精品在线 | 国产精品久久久久久福利一牛影视 | 91在线精品播放 | 狠狠色综合久久婷婷 | 免费激情| 亚洲国产精品va在线看黑人 | 中国大陆高清aⅴ毛片 | 国产精品九九九 | 国产婷婷色综合av蜜臀av | 国产欧美日韩精品在线观看 | www久久久 | 九九热在线精品视频 | 国产美女视频黄a视频免费 国产精品福利视频 | 日韩高清中文字幕 | 久久久久久网站 | 高清一区二区三区 |