{"id":26387874,"url":"https://github.com/qiauil/qstockplotter","last_synced_at":"2026-03-09T19:13:43.922Z","repository":{"id":223354294,"uuid":"760085536","full_name":"qiauil/QStockPlotter","owner":"qiauil","description":"A PyQt-based plotter for stock data","archived":false,"fork":false,"pushed_at":"2025-02-19T20:32:02.000Z","size":641,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-19T21:28:37.306Z","etag":null,"topics":["flunt","gui","pyqt","stocks"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/qiauil.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-02-19T18:56:25.000Z","updated_at":"2024-07-29T21:02:08.000Z","dependencies_parsed_at":null,"dependency_job_id":"de1128da-a3d2-4439-b859-f272bceb0568","html_url":"https://github.com/qiauil/QStockPlotter","commit_stats":null,"previous_names":["qiauil/qstockplotter"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qiauil%2FQStockPlotter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qiauil%2FQStockPlotter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qiauil%2FQStockPlotter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qiauil%2FQStockPlotter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/qiauil","download_url":"https://codeload.github.com/qiauil/QStockPlotter/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244001644,"owners_count":20381806,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["flunt","gui","pyqt","stocks"],"created_at":"2025-03-17T08:37:55.457Z","updated_at":"2026-03-09T19:13:43.906Z","avatar_url":"https://github.com/qiauil.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\n  \u003cimg src=\"./pics/logo.png\" width=\"100\"/\u003e\n  \u003cbr\u003eQStockSimulator\u003cbr\u003e\n\u003c/h1\u003e\n\u003ch4 align=\"center\"\u003eA PyQt-based Plotter for Stock Data\u003c/h4\u003e\n\u003cimg src=\"pics/main.png\" alt=\"\" style=\"zoom: 50%;\" /\u003e\n\n------\n\n## Feature\n\n* Multi-zoom models.\n\n* Custom line drawing.\n\n* Frame recording.\n\n* Moving averaging line supported.\n\n* Dark model and theme color supported (Powered by  [QFluntWidgets](https://qfluentwidgets.com/)).\n\n## Quick Start\n\n### Installation\n\n```bash\ngit clone https://github.com/qiauil/QStockPlotter.git\npip install .\n```\n\n### Invoke the plotter\n\nThe following codes showcase how to invoke the default plotter to display a candlestick chart for a local stock data.\n\n```python\nfrom qstock_plotter import QStockPlotter\nfrom qstock_plotter.libs.data_handler import *\nfrom qstock_plotter.libs.plot_item import *\nfrom PyQt6.QtWidgets import QApplication\nfrom qfluentwidgets import setTheme,setThemeColor,Theme\nimport sys\n\napp = QApplication(sys.argv)\napp.setApplicationName(\"QStockPlotter\")\nsample_stock_data=HDF5Handler(\"./sample_stock_data.h5\")\ngraph_item=get_plot_item(sample_stock_data.day_data.prices) \n#graph_item=get_plot_item(sh35.day_data.volume) #for volume\nwidget=QStockPlotter()\nwidget.show()\nwidget.add_main_item(graph_item,x_ticks=graph_item.get_x_ticks())\n#widget.main_plotter.update_plot(x_loc=widget.main_plotter.x_end-5, x_range=5) # move to the end\n#setTheme(Theme.DARK) #switch to dark theme\n#setThemeColor(\"#0065d5\") #change the theme color\nsys.exit(app.exec())\n```\n\n### Modify the plotter\n\nThe default `QStockPlotter` is built on a series of function components. Each component is independent and provides certain functions. Currently, there are four components:\n\n* `average_line`: A component that handles adding and removing average lines on a plot.\n* `draw_line`: A component for drawing lines on a plot widget.\n* `frame_recorder`: A component for recording and managing frames in a plot widget.\n* `zoom_move`: A component provides scrollers and a zoom control widget for a plot widget\n\nAll the components are located in the `component` folder. These components provide different functions for a basic plotter, which should be an instance of `QPlotWidget`. `QPlotWidget` is a subclass of `PlotWidget` from [PyQtGraph](https://www.pyqtgraph.org/), offering basic plot functions with different zoom models. By developing and integrating the components for the `QPlotWidget`, users can build different complex widgets for different applications. Please refer to the  [source code](https://github.com/qiauil/QStockPlotter/blob/main/qstock_plotter/__init__.py) of `QStockPlotter` to see how these components work with `QPlotWidget`.\n\n### Add more plot item\n\nSince the basis `QPlotWidget` is a subclass of PyQtGraph's PlotWidget, any `GraphicsObject` from PyQtGraph should work for the QPlotWidget. However, to utilize the zoom functions of the `QPlotWidget`, we design a subclass of `GraphicsObject`, `AdaptiveGraphObject`.  Currently, we offer two `AdaptiveGraphObject`s  in the package: ``CandlestickPricesItem` and `CandlestickVolumeItem`. Users can design more `AdaptiveGraphObject` for their own needs. More details can be found in `libs/plot_item`.\n\nWe also introduce the concepts of `DataHandler` and `DataFrame` to build a bridge between raw data and plot items. `DataHandler` is designed to read data from files, e.g., the sample stock data or the internet, and convert the raw data into `DataFrame`, which will later be used by different plot items. More details can be found in `libs/data_hanlder`.\n\n------\n\n## Acknowledgement\n\nThis project is built based on a series of open-source projects, especially the [PyQtGraph](https://www.pyqtgraph.org/) and  [QFluntWidgets](https://qfluentwidgets.com/).\n\n## Sister Project\n* [QStockSimulator](https://github.com/qiauil/QStockSimulator)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqiauil%2Fqstockplotter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fqiauil%2Fqstockplotter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqiauil%2Fqstockplotter/lists"}