Package: chartilo
ChartiloCool chart drawer for pyqt5 with candle supportChartilo is the open-source library which allow you to draw charts on qtpainter with support for lines, candles, bars or heiken-ashi.install librarytype 17 lines of python codeenjoy resultFeatureseasy installationThe ability to create your own drawing based modules on the currentThe ability to create your own color themeScalable architectureTechChartilo uses a number of open source projects to work properly:PyQt5- app build frameworkAnd of course Chartilo itself is open source with apublic repositoryon GitHub.InstallationChatrilo requirespythonv3+ to run.If you didn't install PyQt5...pipinstallpyqt5Install the dependency.pipinstallchartiloDevelopmentReady to code? Great!Make a change in your file and instantaneously see your updates!Open your favorite code editor and paste these code lines.The base sctructure likes this, you can browse demo versionhereimportsysfromPyQt5.QtWidgetsimportQApplication,QBoxLayout,QMainWindow,QVBoxLayout,QWidgetfromPyQt5importuicfromPyQt5.QtWidgetsimportQApplication,QMainWindowfromchartiloimportChartilofromchartilo.drawersimportGridDrawer,CandleChartDrawer,LineChartDrawer,LineDrawer,MaxMinValuesDrawerfromastimportliteral_evalfromchartilo.modelsimportLine,Candlefromchartilo.themesimportLight,DarkclassMyWidget(QMainWindow):def__init__(self):super().__init__()uic.loadUi('untitled.ui',self)# adding canvas to frameself._chartilo=Chartilo()layout=QVBoxLayout()layout.addWidget(self._chartilo)self.frame.setLayout(layout)# setting statesstates={"type":Candle,"theme":Dark,"drawers":{"grid":GridDrawer,"lineChart":CandleChartDrawer,"line":LineDrawer,"maxMinDrawer":MaxMinValuesDrawer},}# getting datafile=open("data.txt","r")data=literal_eval(file.read())# setting data, states and running libraryself._chartilo.setData(data)self._chartilo.setStates(states)self._chartilo.updateCanvas()if__name__=='__main__':app=QApplication(sys.argv)ex=MyWidget()ex.show()sys.exit(app.exec_())First of all, you must have a qtframe in order to insert a painter there:classMyWidget(QMainWindow):def__init__(self):super().__init__()uic.loadUi('uifile.ui',self)# adding painter to frameself._chartilo=Chartilo()layout=QVBoxLayout()layout.addWidget(self._chartilo)self.frame.setLayout(layout)Second step is to create setting of library:this is how you can implement drawers, models, themes from chartilo library:# setting statesstates={"type":Candle,# the type of chart(liner or candler)"theme":Dark,# theme of chart (light or dark)"drawers":{"grid":GridDrawer,# class is used to draw grid for chart"lineChart":CandleChartDrawer,# class is used to draw candles"line":LineDrawer,# showing curren price line"maxMinDrawer":MaxMinValuesDrawer# showing maximum and minimum of chart},}Note:Type of vertexes and type of vertexes darwershould be same for proper work.Note:you can remove some of the classes to get the functionality you want# this is how you can import drawers from chartilo libraryfromchartilo.drawersimportGridDrawer,CandleChartDrawer,LineChartDrawer,LineDrawer,MaxMinValuesDrawer,DrawerNote:Draweris required if you wanna build your own drawer.# this is how you can import models from chartilo library:fromchartilo.modelsimportLine,CandleNote:modelsis setting the type of vertexes and you can create your own models to draw them in your own drawers using base drawer class for calculation.this is how line generatesclassLine:width=8def__init__(self,data):self.closeTime=data[0]# NOT REQUIRED close timeself.openPrice=float(data[1])# open priceself.closePrice=float(data[4])# close pricethis is how candle generatesfrom.importLineclassCandle(Line):width=8def__init__(self,data):super().__init__(data);# open and close price look aboveself.maximalPrice=float(data[2])# maximal priceself.minimalPrice=float(data[3])# minimal price# this is how you can import themes, the default is Darkfromchartilo.themesimportLight,Dark,ThemeNote:Themeis required if you wanna create your own theme.The last step:# setting data, states and running libraryself._chartilo.setData(data)self._chartilo.setStates(states)self._chartilo.updateCanvas()Note:datamust be a two-dimensional array [[closeTime, openPrice, maximalPrice, minimalPrice, closePrice], [closeTime, openPrice, maximalPrice, minimalPrice, closePrice]] examplehereanother fields are not required yet.This is all have a nice dayif this is not enougth you can browse crypto-meneger-projecthereLicenseMITFree Software, Hell Yeah!