Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Chartilo is the open-source library which allow you to draw charts on qtpainter with support for lines, candles, bars or heiken-ashi.
install library
type 17 lines of python code
enjoy result
easy installation
The ability to create your own drawing based modules on the current
The ability to create your own color theme
Scalable architecture
Chartilo uses a number of open source projects to work properly:
And of course Chartilo itself is open source with a public repository
on GitHub.
Chatrilo requires python v3+ to run.
If you didn't install PyQt5...
pip install pyqt5
Install the dependency.
pip install chartilo
Ready 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 version here
import sys
from PyQt5.QtWidgets import QApplication, QBoxLayout, QMainWindow, QVBoxLayout, QWidget
from PyQt5 import uic
from PyQt5.QtWidgets import QApplication, QMainWindow
from chartilo import Chartilo
from chartilo.drawers import GridDrawer, CandleChartDrawer, LineChartDrawer, LineDrawer, MaxMinValuesDrawer
from ast import literal_eval
from chartilo.models import Line, Candle
from chartilo.themes import Light, Dark
class MyWidget(QMainWindow):
def __init__(self):
super().__init__()
uic.loadUi('untitled.ui', self)
# adding canvas to frame
self._chartilo = Chartilo()
layout = QVBoxLayout()
layout.addWidget(self._chartilo)
self.frame.setLayout(layout)
# setting states
states = {
"type" : Candle,
"theme": Dark,
"drawers" : {
"grid" : GridDrawer,
"lineChart" : CandleChartDrawer,
"line" : LineDrawer,
"maxMinDrawer" : MaxMinValuesDrawer
},
}
# getting data
file = open("data.txt", "r")
data = literal_eval(file.read())
# setting data, states and running library
self._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:
class MyWidget(QMainWindow):
def __init__(self):
super().__init__()
uic.loadUi('uifile.ui', self)
# adding painter to frame
self._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 states
states = {
"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 darwer
should 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 library
from chartilo.drawers import GridDrawer, CandleChartDrawer, LineChartDrawer, LineDrawer, MaxMinValuesDrawer, Drawer
Note:
Drawer
is required if you wanna build your own drawer.
# this is how you can import models from chartilo library:
from chartilo.models import Line, Candle
Note:
models
is 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 generates
class Line:
width = 8
def __init__(self, data):
self.closeTime = data[0] # NOT REQUIRED close time
self.openPrice = float(data[1]) # open price
self.closePrice = float(data[4]) # close price
this is how candle generates
from . import Line
class Candle(Line):
width = 8
def __init__(self, data):
super().__init__(data); # open and close price look above
self.maximalPrice = float(data[2]) # maximal price
self.minimalPrice = float(data[3]) # minimal price
# this is how you can import themes, the default is Dark
from chartilo.themes import Light, Dark, Theme
Note:
Theme
is required if you wanna create your own theme.
The last step:
# setting data, states and running library
self._chartilo.setData(data)
self._chartilo.setStates(states)
self._chartilo.updateCanvas()
Note:
data
must be a two-dimensional array [[closeTime, openPrice, maximalPrice, minimalPrice, closePrice], [closeTime, openPrice, maximalPrice, minimalPrice, closePrice]] example here another fields are not required yet.
This is all have a nice day
if this is not enougth you can browse crypto-meneger-project here
MIT
Free Software, Hell Yeah!
FAQs
Streaming video data via networks
We found that chartilo demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.