mirror of
https://github.com/Relintai/pandemonium_engine_easy_charts.git
synced 2024-11-20 10:47:22 +01:00
update dataframe plotting
This commit is contained in:
parent
0d44e72b7c
commit
2303617e90
@ -355,6 +355,8 @@ func plot_from_source(file : String, _delimiter : String = delimiter) -> void:
|
||||
plot(read_data(file, _delimiter))
|
||||
|
||||
func plot_from_dataframe(dataframe : DataFrame) -> void:
|
||||
assert(dataframe.headers.size() > 1 or dataframe.labels.size() > 1,
|
||||
"Cannot plot a dataframe of size %sx%s"%[dataframe.headers.size(), dataframe.labels.size()])
|
||||
self.dataframe = dataframe
|
||||
plot(dataframe.get_dataset())
|
||||
|
||||
|
@ -478,8 +478,10 @@ func count_functions():
|
||||
|
||||
# Calculate distance in pixel between 2 consecutive values/datas
|
||||
func calculate_pass():
|
||||
x_pass = (SIZE.x - OFFSET.x) / (x_chors.size() - 1 if x_chors.size() > 1 else x_chors.size())
|
||||
y_pass = (origin.y - ChartName.get_rect().size.y * 2) / (y_chors.size() - 1 if y_chors.size() > 1 else y_chors.size())
|
||||
if x_chors.size() > 0:
|
||||
x_pass = (SIZE.x - OFFSET.x) / (x_chors.size() - 1 if x_chors.size() > 1 else x_chors.size())
|
||||
if y_chors.size() > 0:
|
||||
y_pass = (origin.y - ChartName.get_rect().size.y * 2) / (y_chors.size() - 1 if y_chors.size() > 1 else y_chors.size())
|
||||
|
||||
|
||||
# Calculate all Points' coordinates in the dataset
|
||||
|
Loading…
Reference in New Issue
Block a user