From d934b5ed6b648ea07167d14345b1379a5475c356 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Santilio?= Date: Tue, 12 Jan 2021 15:02:55 +0100 Subject: [PATCH] fix linechart datatype bug --- README.md | 2 +- addons/easy_charts/LineChart/line_chart.gd | 4 ++-- addons/easy_charts/PieChart/PieChart.tscn | 8 ++++---- addons/easy_charts/Utilities/Scripts/chart.gd | 2 +- addons/easy_charts/plugin.cfg | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 40152b4..855e87d 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ # Easy Charts A library of Charts plotted in Control, 2D and 3D nodes to visualize general purpose datasets. Author: *"Nicolo (fenix) Santilio"* -Version: *0.5.3* +Version: *0.5.6* Wiki: *[wip](https://github.com/fenix-hub/godot-engine.easy-charts/wiki)* Godot Version: *3.2stable* diff --git a/addons/easy_charts/LineChart/line_chart.gd b/addons/easy_charts/LineChart/line_chart.gd index 8b398f1..a3e8358 100644 --- a/addons/easy_charts/LineChart/line_chart.gd +++ b/addons/easy_charts/LineChart/line_chart.gd @@ -163,14 +163,14 @@ func structure_datas(database: Array): for column in database[row].size(): if column == labels_index: var x_data = database[row][column] - if x_data.is_valid_float() or x_data.is_valid_integer(): + if typeof(x_data) == TYPE_INT or typeof(x_data) == TYPE_REAL: x_datas.append(x_data as float) else: x_datas.append(x_data) else: if row != 0: var y_data = database[row][column] - if y_data.is_valid_float() or y_data.is_valid_integer(): + if typeof(y_data) == TYPE_INT or typeof(y_data) == TYPE_REAL: t_vals.append(y_data as float) else: t_vals.append(y_data.replace(",", ".") as float) diff --git a/addons/easy_charts/PieChart/PieChart.tscn b/addons/easy_charts/PieChart/PieChart.tscn index f40ea56..bd04eea 100644 --- a/addons/easy_charts/PieChart/PieChart.tscn +++ b/addons/easy_charts/PieChart/PieChart.tscn @@ -57,9 +57,9 @@ __meta__ = { [node name="PointData" parent="." instance=ExtResource( 2 )] [node name="PointData" parent="PointData" index="0"] -margin_left = -375.27 -margin_top = -216.457 -margin_right = -375.37 -margin_bottom = -215.657 +margin_left = -314.458 +margin_top = -189.587 +margin_right = -314.559 +margin_bottom = -188.787 [editable path="PointData"] diff --git a/addons/easy_charts/Utilities/Scripts/chart.gd b/addons/easy_charts/Utilities/Scripts/chart.gd index 435d5c0..d0bfd38 100644 --- a/addons/easy_charts/Utilities/Scripts/chart.gd +++ b/addons/easy_charts/Utilities/Scripts/chart.gd @@ -359,7 +359,7 @@ func plot_from_array(array : Array) -> void: Utilities._print_message("Can't plot a chart with an empty Array.",1) return - data = array.duplicate() + data = array.duplicate(true) structure_datas(slice_data()) build_chart() count_functions() diff --git a/addons/easy_charts/plugin.cfg b/addons/easy_charts/plugin.cfg index 44f49ce..65be60f 100644 --- a/addons/easy_charts/plugin.cfg +++ b/addons/easy_charts/plugin.cfg @@ -3,5 +3,5 @@ name="EasyCharts" description="" author="Nicolò \"fenix\" Santilio" -version="0.5.0" +version="0.5.6" script="plugin.gd"