fix linechart datatype bug

This commit is contained in:
Nicolò Santilio 2021-01-12 15:02:55 +01:00
parent a1bea161fa
commit d934b5ed6b
5 changed files with 9 additions and 9 deletions

View File

@ -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*

View File

@ -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)

View File

@ -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"]

View File

@ -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()

View File

@ -3,5 +3,5 @@
name="EasyCharts"
description=""
author="Nicolò \"fenix\" Santilio"
version="0.5.0"
version="0.5.6"
script="plugin.gd"