diff --git a/Assets/Chart And Graph.meta b/Assets/Chart And Graph.meta
new file mode 100644
index 00000000..507e4060
--- /dev/null
+++ b/Assets/Chart And Graph.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 21ab74f6196c6da4eb277c2615345f1b
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Chart And Graph/3rd party notices.txt b/Assets/Chart And Graph/3rd party notices.txt
new file mode 100644
index 00000000..f78803fa
--- /dev/null
+++ b/Assets/Chart And Graph/3rd party notices.txt
@@ -0,0 +1,19 @@
+The following 3rd parties are integrated into Graph and Chart:
+
+In the folder Chart And Graph/Themes/Common/Fonts :
+
+Each font has it's own folder with full license detials
+
+Exo2 - SIL OPEN FONT LICENSE - https://www.fontsquirrel.com/license/exo-2
+ABeeZee - SIL OPEN FONT LICENSE - https://www.fontsquirrel.com/license/abeezee
+Comprehension - SIL OPEN FONT LICENSE - https://www.fontsquirrel.com/license/comprehension
+Enriqueta - SIL OPEN FONT LICENSE - https://www.fontsquirrel.com/license/enriqueta
+Fengardo-neue - SIL OPEN FONT LICENSE - https://www.fontsquirrel.com/license/fengardo-neue
+Overpass - SIL OPEN FONT LICENSE - https://www.fontsquirrel.com/license/overpass
+Rambla - SIL OPEN FONT LICENSE - https://www.fontsquirrel.com/license/rambla
+Scada - SIL OPEN FONT LICENSE - https://www.fontsquirrel.com/license/scada
+
+SimpleJson in the folder Chart And Graph/SimpleJSON-master:
+Licensed under MIT license :https://github.com/Bunny83/SimpleJSON/blob/master/LICENSE
+
+
diff --git a/Assets/Chart And Graph/3rd party notices.txt.meta b/Assets/Chart And Graph/3rd party notices.txt.meta
new file mode 100644
index 00000000..09279e72
--- /dev/null
+++ b/Assets/Chart And Graph/3rd party notices.txt.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: b593c70250d4fb94bb76f653a500cd6d
+timeCreated: 1536774863
+licenseType: Store
+TextScriptImporter:
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Chart And Graph/ChartParser.meta b/Assets/Chart And Graph/ChartParser.meta
new file mode 100644
index 00000000..7e668756
--- /dev/null
+++ b/Assets/Chart And Graph/ChartParser.meta
@@ -0,0 +1,9 @@
+fileFormatVersion: 2
+guid: c3cc22ffba1b29a44b56007d189a1750
+folderAsset: yes
+timeCreated: 1536396364
+licenseType: Store
+DefaultImporter:
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Chart And Graph/ChartParser/ChartParser.cs b/Assets/Chart And Graph/ChartParser/ChartParser.cs
new file mode 100644
index 00000000..89f3ae06
--- /dev/null
+++ b/Assets/Chart And Graph/ChartParser/ChartParser.cs
@@ -0,0 +1,26 @@
+#define Graph_And_Chart_PRO
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace ChartAndGraph
+{
+ public abstract class ChartParser
+ {
+ public abstract bool SetPathRelativeTo(string pathObject);
+ ///
+ /// returns null if object not found
+ ///
+ ///
+ ///
+ public abstract object GetObject(string name);
+ public abstract object GetChildObject(object obj, string name);
+ public abstract IEnumerable> GetAllChildObjects(object obj);
+ public abstract string GetChildObjectValue(object obj, string name);
+ public abstract string GetItem(object arr, int item);
+ public abstract object GetItemObject(object arr, int item);
+ public abstract int GetArraySize(object arr);
+ public abstract string ObjectValue(object obj);
+ }
+}
diff --git a/Assets/Chart And Graph/ChartParser/ChartParser.cs.meta b/Assets/Chart And Graph/ChartParser/ChartParser.cs.meta
new file mode 100644
index 00000000..a76bbfd0
--- /dev/null
+++ b/Assets/Chart And Graph/ChartParser/ChartParser.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 5948d4ad51f370c4f927d0d10573cc84
+timeCreated: 1536396364
+licenseType: Store
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Chart And Graph/ChartParser/JsonParser.cs b/Assets/Chart And Graph/ChartParser/JsonParser.cs
new file mode 100644
index 00000000..7fe0d479
--- /dev/null
+++ b/Assets/Chart And Graph/ChartParser/JsonParser.cs
@@ -0,0 +1,134 @@
+#define Graph_And_Chart_PRO
+using SimpleJSON;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using UnityEngine;
+
+namespace ChartAndGraph
+{
+ class JsonParser : ChartParser
+ {
+ JSONNode mBaseJson;
+ JSONNode mRelativePath;
+ public JsonParser(string data)
+ {
+
+ mBaseJson = JSON.Parse(data);
+ mRelativePath = mBaseJson;
+ }
+
+ object GetObjectFromRoot(JSONNode root, string name)
+ {
+ string[] parents = name.Split('>');
+ object current = root;
+ for (int i = 0; current != null && i < parents.Length; i++)
+ {
+ string nextNode = parents[i];
+ current = GetChildObject(current, nextNode);
+ }
+ return current;
+ }
+
+ public override int GetArraySize(object arr)
+ {
+ var node = (JSONNode)arr;
+ if (node.IsArray == false)
+ return 0;
+ return node.Count;
+ }
+
+ public override object GetChildObject(object obj, string name)
+ {
+ var node = (JSONNode)obj;
+ if (name.Length <= 0)
+ return obj;
+ if (char.IsDigit(name[0])) // if it is a number then find by order , atag name cannot start with a digit
+ {
+ if (node.IsArray == false)
+ return null;
+ int index = 0;
+ if (int.TryParse(name, out index) == false) // try parsing the number
+ return null;
+ if (index < 0 || index >= node.Count)
+ return null;
+ return node[index];
+ }
+ if(name.Length>=2 && name[0] == '"' && name[name.Length-1] == '"')
+ {
+ name = name.Substring(1, name.Length - 2); //strip quatation marks
+ }
+ return node[name];
+ }
+
+
+ public override bool SetPathRelativeTo(string pathObject)
+ {
+ mRelativePath = (JSONNode)GetObjectFromRoot(mBaseJson, pathObject);
+ if (mRelativePath == null)
+ {
+ mRelativePath = mBaseJson;
+ return false;
+ }
+ return true;
+ }
+
+ public override object GetObject(string name)
+ {
+ return GetObjectFromRoot(mRelativePath, name);
+ }
+
+ public override string GetItem(object arr, int item)
+ {
+ var element = arr as JSONNode;
+ if (element == null)
+ return null;
+ var child = element[item] as JSONNode;
+ if (child == null)
+ return null;
+ return ObjectValue(child);
+ }
+
+ public override object GetItemObject(object arr, int item)
+ {
+ var element = arr as JSONNode;
+ if (element == null)
+ return null;
+ var child = element[item];
+ return child;
+ }
+
+ public override string ObjectValue(object obj)
+ {
+ var element = obj as JSONNode;
+ return element.Value;
+ }
+
+ public override string GetChildObjectValue(object obj, string name)
+ {
+ var element = obj as JSONNode;
+ if (element == null)
+ return null;
+ try
+ {
+ var child = element[name] as JSONNode;
+ return ObjectValue(child);
+ }
+ catch(Exception)
+ {
+
+ }
+ return null;
+ }
+
+ public override IEnumerable> GetAllChildObjects(object obj)
+ {
+ var node = (JSONNode)obj;
+ if (node.IsObject == false)
+ yield break;
+ foreach(var key in node.Keys)
+ yield return new KeyValuePair(key, node[key]);
+ }
+ }
+}
diff --git a/Assets/Chart And Graph/ChartParser/JsonParser.cs.meta b/Assets/Chart And Graph/ChartParser/JsonParser.cs.meta
new file mode 100644
index 00000000..11018003
--- /dev/null
+++ b/Assets/Chart And Graph/ChartParser/JsonParser.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 0693b788053aab64a88908e1e3d6b944
+timeCreated: 1536396364
+licenseType: Store
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Chart And Graph/ChartParser/XMLParser.cs b/Assets/Chart And Graph/ChartParser/XMLParser.cs
new file mode 100644
index 00000000..925026fb
--- /dev/null
+++ b/Assets/Chart And Graph/ChartParser/XMLParser.cs
@@ -0,0 +1,146 @@
+#define Graph_And_Chart_PRO
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Text;
+#if WINDOWS_UWP
+using Windows.Data.Xml.Dom;
+#else
+using System.Xml;
+#endif
+
+namespace ChartAndGraph
+{
+ class XMLParser : ChartParser
+ {
+ XmlDocument mXmlDoc;
+ XmlElement mRelativeElement;
+
+ public XMLParser(string xml)
+ {
+ mXmlDoc = new XmlDocument();
+#if WINDOWS_UWP
+ mXmlDoc.LoadXml(xml);
+#else
+ using (var reader = new StringReader(xml))
+ {
+ mXmlDoc.Load(reader);
+ }
+#endif
+ mRelativeElement = mXmlDoc.DocumentElement;
+ }
+
+ public override int GetArraySize(object arr)
+ {
+ var element = arr as XmlElement;
+ if (element == null)
+ return 0;
+ return element.ChildNodes.Count;
+ }
+
+ public override object GetChildObject(object obj, string name)
+ {
+ var node = (XmlElement)obj;
+ if (name.Length <= 0)
+ return obj;
+ if (char.IsDigit(name[0])) // if it is a number then find by order , atag name cannot start with a digit
+ {
+ int index = 0;
+ if (int.TryParse(name, out index) == false) // try parsing the number
+ return null;
+ if (index < 0 || index >= node.ChildNodes.Count)
+ return null;
+ return node.ChildNodes[index];
+ }
+
+ return node.SelectSingleNode(name);
+ }
+
+ public override object GetItemObject(object arr, int item)
+ {
+ var element = arr as XmlElement;
+ if (element == null)
+ return null;
+ var child = element.ChildNodes[item] as XmlElement;
+ return child;
+ }
+
+ object GetObjectFromRoot(XmlElement root, string name)
+ {
+ string[] parents = name.Split('>');
+ object current = root;
+ for (int i = 0; current != null && i < parents.Length; i++)
+ {
+ string nextNode = parents[i];
+ current = GetChildObject(current, nextNode);
+ }
+ return current;
+ }
+
+ public override object GetObject(string name)
+ {
+ return GetObjectFromRoot(mRelativeElement, name);
+ }
+
+ public override bool SetPathRelativeTo(string pathObject)
+ {
+ mRelativeElement = (XmlElement)GetObjectFromRoot(mXmlDoc.DocumentElement, pathObject);
+ if (mRelativeElement == null)
+ {
+ mRelativeElement = mXmlDoc.DocumentElement;
+ return false;
+ }
+ return true;
+ }
+
+ public override string GetChildObjectValue(object obj, string name)
+ {
+ var element = obj as XmlElement;
+ if (element == null)
+ return null;
+ var child = element.SelectSingleNode(name) as XmlElement;
+ if (child == null)
+ return null;
+ return ObjectValue(child);
+ }
+
+ public override string GetItem(object arr, int item)
+ {
+ var element = arr as XmlElement;
+ if (element == null)
+ return null;
+ var child = element.ChildNodes[item] as XmlElement;
+ if (child == null)
+ return null;
+ return ObjectValue(child);
+ }
+
+ public override string ObjectValue(object obj)
+ {
+ var element = obj as XmlElement;
+ if (element == null)
+ return null;
+ return element.InnerText;
+ }
+
+ public override IEnumerable> GetAllChildObjects(object obj)
+ {
+ var element = obj as XmlElement;
+ if (element == null)
+ yield break;
+ foreach(var node in element.ChildNodes)
+ {
+ var xml = node as XmlElement;
+ if(xml != null)
+ {
+#if WINDOWS_UWP
+ yield return new KeyValuePair(xml.TagName, xml);
+#else
+ yield return new KeyValuePair(xml.Name, xml);
+#endif
+ }
+ }
+ }
+ }
+}
diff --git a/Assets/Chart And Graph/ChartParser/XMLParser.cs.meta b/Assets/Chart And Graph/ChartParser/XMLParser.cs.meta
new file mode 100644
index 00000000..cbea48d8
--- /dev/null
+++ b/Assets/Chart And Graph/ChartParser/XMLParser.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 878b8742852947849810df5d673d597c
+timeCreated: 1536396365
+licenseType: Store
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Chart And Graph/Editor.meta b/Assets/Chart And Graph/Editor.meta
new file mode 100644
index 00000000..6974cd72
--- /dev/null
+++ b/Assets/Chart And Graph/Editor.meta
@@ -0,0 +1,9 @@
+fileFormatVersion: 2
+guid: bf8f979c9af34ff43ab739a7cf401b92
+folderAsset: yes
+timeCreated: 1560597265
+licenseType: Store
+DefaultImporter:
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Chart And Graph/Editor/AutoFloatInspector.cs b/Assets/Chart And Graph/Editor/AutoFloatInspector.cs
new file mode 100644
index 00000000..5e264683
--- /dev/null
+++ b/Assets/Chart And Graph/Editor/AutoFloatInspector.cs
@@ -0,0 +1,32 @@
+#define Graph_And_Chart_PRO
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using UnityEditor;
+using UnityEngine;
+
+namespace ChartAndGraph
+{
+ [CustomPropertyDrawer(typeof(AutoFloat))]
+ class AutoFloatInspector : PropertyDrawer
+ {
+ public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
+ {
+ label = EditorGUI.BeginProperty(position, label, property);
+ position = EditorGUI.PrefixLabel(position, GUIUtility.GetControlID(FocusType.Passive), label);
+ SerializedProperty auto = property.FindPropertyRelative("Automatic");
+ SerializedProperty val = property.FindPropertyRelative("Value");
+ int indent = EditorGUI.indentLevel;
+ EditorGUI.indentLevel = 0;
+ bool res = EditorGUI.ToggleLeft(position,"Auto",auto.boolValue);
+ EditorGUI.indentLevel = indent;
+ EditorGUI.indentLevel++;
+ if (auto.boolValue == false && EditorGUI.showMixedValue == false)
+ val.floatValue = EditorGUILayout.FloatField("Value",val.floatValue);
+ auto.boolValue = res;
+ EditorGUI.indentLevel--;
+ EditorGUI.EndProperty();
+ }
+ }
+}
diff --git a/Assets/Chart And Graph/Editor/AutoFloatInspector.cs.meta b/Assets/Chart And Graph/Editor/AutoFloatInspector.cs.meta
new file mode 100644
index 00000000..3ebb8845
--- /dev/null
+++ b/Assets/Chart And Graph/Editor/AutoFloatInspector.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: c989bbf118ca01e4aab213559170875f
+timeCreated: 1479209594
+licenseType: Store
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Chart And Graph/Editor/AxisInspector.cs b/Assets/Chart And Graph/Editor/AxisInspector.cs
new file mode 100644
index 00000000..d84906e9
--- /dev/null
+++ b/Assets/Chart And Graph/Editor/AxisInspector.cs
@@ -0,0 +1,273 @@
+#define Graph_And_Chart_PRO
+using ChartAndGraph;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Reflection;
+using UnityEditor;
+using UnityEngine;
+
+namespace ChartAndGraph
+{
+ [CustomEditor(typeof(AxisBase), true)]
+ class AxisInspector : Editor
+ {
+ bool mMain = false;
+ bool mSub = false;
+
+ public override void OnInspectorGUI()
+ {
+ AxisBase axis = (AxisBase)target;
+
+ if (axis.gameObject == null)
+ return;
+
+ AnyChart chart = axis.gameObject.GetComponent();
+ if (chart == null)
+ return;
+ if((chart is AxisChart) == false)
+ {
+ EditorGUILayout.LabelField(string.Format("Chart of type {0} does not support axis",chart.GetType().Name));
+ return;
+ }
+ SerializedProperty simpleViewProp = serializedObject.FindProperty("SimpleView");
+ if (simpleViewProp == null)
+ return;
+
+ Type canvasType = (chart is ICanvas) ? typeof(CanvasAttribute) : typeof(NonCanvasAttribute);
+
+ EditorGUILayout.BeginVertical();
+ bool negate = false;
+ if (simpleViewProp.boolValue == true)
+ negate = GUILayout.Button("Advanced View");
+ else
+ negate = GUILayout.Button("Simple View");
+ if (negate)
+ simpleViewProp.boolValue = !simpleViewProp.boolValue;
+ bool simple = simpleViewProp.boolValue;
+
+
+ SerializedProperty depth = serializedObject.FindProperty("depth");
+ if (depth != null)
+ EditorGUILayout.PropertyField(depth);
+ SerializedProperty format= serializedObject.FindProperty("format");
+ EditorGUILayout.PropertyField(format);
+ if (simple)
+ DoSimpleView(canvasType);
+ else
+ DoAdvanvedView(canvasType,true);
+
+ EditorGUILayout.EndVertical();
+ serializedObject.ApplyModifiedProperties();
+ serializedObject.Update();
+ }
+
+ void SetValue(SerializedProperty assignTo,SerializedProperty from)
+ {
+
+ if(assignTo.propertyType != from.propertyType)
+ {
+ Debug.LogWarning("type does not match");
+ return;
+ }
+
+ if (assignTo.type == "AutoFloat")
+ {
+ SerializedProperty auto = assignTo.FindPropertyRelative("Automatic");
+ SerializedProperty val = assignTo.FindPropertyRelative("Value");
+ SerializedProperty autofrom = from.FindPropertyRelative("Automatic");
+ SerializedProperty valfrom = from.FindPropertyRelative("Value");
+ auto.boolValue = autofrom.boolValue;
+ val.floatValue = valfrom.floatValue;
+ return;
+ }
+
+ switch (assignTo.propertyType)
+ {
+ case SerializedPropertyType.Float:
+ assignTo.floatValue = from.floatValue;
+ break;
+ case SerializedPropertyType.Integer:
+ assignTo.intValue = from.intValue;
+ break;
+ case SerializedPropertyType.Enum:
+ assignTo.enumValueIndex = from.enumValueIndex;
+ break;
+ case SerializedPropertyType.Boolean:
+ assignTo.boolValue = from.boolValue;
+ break;
+ case SerializedPropertyType.String:
+ assignTo.stringValue = from.stringValue;
+ break;
+ case SerializedPropertyType.ObjectReference:
+ assignTo.objectReferenceValue = from.objectReferenceValue;
+ break;
+ default:
+ Debug.LogWarning("type cannot be set");
+ break;
+ }
+ }
+
+ Type getTypeFromField(Type type,string fieldName)
+ {
+ FieldInfo inf = type.GetField(fieldName, BindingFlags.NonPublic | BindingFlags.Instance);
+ if (inf == null)
+ return null;
+ return inf.FieldType;
+ }
+
+ bool CompareValues(Type type,string fieldName,object a,object b)
+ {
+ FieldInfo inf= type.GetField(fieldName, BindingFlags.NonPublic | BindingFlags.Instance);
+ object valA = inf.GetValue(a);
+ object valB = inf.GetValue(b);
+ if(valA is UnityEngine.Object && valB is UnityEngine.Object)
+ {
+ if(((UnityEngine.Object)valA) == ((UnityEngine.Object)valB))
+ return true;
+ return false;
+ }
+ if (valA == null && valB == null)
+ return true;
+ return valA.Equals(valB);
+ }
+
+ void DoSimpleView(Type canvasType)
+ {
+ SerializedProperty it = serializedObject.FindProperty("mainDivisions");
+ SerializedProperty SubDivisions = serializedObject.FindProperty("subDivisions");
+ object mainDivision = ((AxisBase)target).MainDivisions;
+ object subDivision = ((AxisBase)target).SubDivisions;
+ if (it == null || SubDivisions == null)
+ return;
+ SerializedProperty end = it.GetEndProperty();
+ while(it.NextVisible(true) && SerializedProperty.EqualContents(end,it) == false)
+ {
+ if (it.name == "SimpleView")
+ continue;
+ if (ChartEditorCommon.HasAttributeOfType(typeof(ChartDivisionInfo), it.name, canvasType) == false)
+ if (ChartEditorCommon.HasAttributeOfType(typeof(AxisBase), it.name, canvasType) == false)
+ continue;
+ if (ChartEditorCommon.HasAttributeOfType(typeof(AxisBase), it.name, typeof(SimpleAttribute)) == false)
+ if (ChartEditorCommon.HasAttributeOfType(typeof(ChartDivisionInfo), it.name, typeof(SimpleAttribute)) == false)
+ continue;
+ SerializedProperty clone = SubDivisions.FindPropertyRelative(it.name);
+ if (clone == null)
+ Debug.LogWarning("can't find property " + it.name);
+ bool equal = CompareValues(typeof(ChartDivisionInfo), clone.name, mainDivision, subDivision);
+ Type t = getTypeFromField(typeof(ChartDivisionInfo), clone.name);
+ EditorGUI.BeginChangeCheck();
+ EditorGUI.showMixedValue = !equal;
+ DoMixedFiled(it, t);
+ EditorGUI.showMixedValue = false;
+ if (EditorGUI.EndChangeCheck())
+ SetValue(clone, it);
+ }
+ DoAdvanvedView(canvasType,false);
+ }
+ public void DoMixedFiled(SerializedProperty prop,Type type)
+ {
+ if(prop.type == "AutoFloat")
+ {
+ EditorGUILayout.BeginHorizontal();
+ EditorGUILayout.PrefixLabel(prop.displayName);
+ SerializedProperty auto = prop.FindPropertyRelative("Automatic");
+ SerializedProperty val = prop.FindPropertyRelative("Value");
+ auto.boolValue = EditorGUILayout.ToggleLeft("Auto", auto.boolValue);
+ EditorGUILayout.EndHorizontal();
+ EditorGUI.indentLevel++;
+ if (auto.boolValue == false && EditorGUI.showMixedValue == false)
+ val.floatValue = EditorGUILayout.FloatField("Value",val.floatValue);
+ EditorGUI.indentLevel--;
+
+ return;
+ }
+ switch(prop.propertyType)
+ {
+ case SerializedPropertyType.Float:
+ if(prop.name == "FontSharpness")
+ prop.floatValue = EditorGUILayout.Slider(prop.displayName, prop.floatValue,1f,3f);
+ else
+ prop.floatValue = EditorGUILayout.FloatField(prop.displayName,prop.floatValue);
+ break;
+ case SerializedPropertyType.Integer:
+ if (prop.name == "FractionDigits")
+ prop.intValue = EditorGUILayout.IntSlider(prop.displayName, prop.intValue,0,7);
+ else
+ prop.intValue = EditorGUILayout.IntField(prop.displayName, prop.intValue);
+ break;
+ case SerializedPropertyType.Enum:
+ ChartDivisionAligment selected = (ChartDivisionAligment)Enum.Parse( typeof(ChartDivisionAligment), prop.enumNames[prop.enumValueIndex]);
+ Enum res = EditorGUILayout.EnumPopup(prop.displayName, selected);
+ string newName= Enum.GetName(typeof(ChartDivisionAligment), res);
+ for (int i = 0; i < prop.enumNames.Length; ++i)
+ {
+ if (prop.enumNames[i] == newName)
+ {
+ prop.enumValueIndex = i;
+ break;
+ }
+ }
+ break;
+ case SerializedPropertyType.String:
+ prop.stringValue = EditorGUILayout.TextField(prop.displayName, prop.stringValue);
+ break;
+ case SerializedPropertyType.Boolean:
+ prop.boolValue = EditorGUILayout.Toggle(prop.displayName, prop.boolValue);
+ break;
+ case SerializedPropertyType.ObjectReference:
+ if(type != null)
+ prop.objectReferenceValue = EditorGUILayout.ObjectField(prop.displayName, prop.objectReferenceValue, type, true);
+ break;
+ default:
+ Debug.LogWarning("type cannot be set");
+ break;
+ }
+ }
+
+ void DoAdvanvedView(Type canvasType,bool includeSimple)
+ {
+ SerializedProperty mainDivisions = serializedObject.FindProperty("mainDivisions");
+ SerializedProperty subDivisions = serializedObject.FindProperty("subDivisions");
+ mMain =mainDivisions.isExpanded = EditorGUILayout.Foldout(mainDivisions.isExpanded, "Main Divisions");
+ if (mMain)
+ {
+ EditorGUI.indentLevel++;
+
+ SerializedProperty end = mainDivisions.GetEndProperty();
+ while (mainDivisions.NextVisible(true) && SerializedProperty.EqualContents(mainDivisions, end) == false)
+ {
+ if (ChartEditorCommon.HasAttributeOfType(typeof(ChartDivisionInfo), mainDivisions.name, canvasType) == false)
+ if (ChartEditorCommon.HasAttributeOfType(typeof(AxisBase), mainDivisions.name, canvasType) == false)
+ continue;
+ if (includeSimple == false)
+ {
+ if (ChartEditorCommon.HasAttributeOfType(typeof(ChartDivisionInfo), mainDivisions.name, typeof(SimpleAttribute)))
+ continue;
+ }
+ EditorGUILayout.PropertyField(mainDivisions);
+ }
+ EditorGUI.indentLevel--;
+ }
+ mSub = subDivisions.isExpanded = EditorGUILayout.Foldout(subDivisions.isExpanded, "Sub Divisions");
+ if (mSub)
+ {
+ EditorGUI.indentLevel++;
+ SerializedProperty end = subDivisions.GetEndProperty();
+ while (subDivisions.NextVisible(true) && SerializedProperty.EqualContents(subDivisions, end) == false)
+ {
+ if (ChartEditorCommon.HasAttributeOfType(typeof(ChartDivisionInfo), subDivisions.name, canvasType) == false)
+ if (ChartEditorCommon.HasAttributeOfType(typeof(AxisBase), subDivisions.name, canvasType) == false)
+ continue;
+ if (includeSimple == false)
+ {
+ if (ChartEditorCommon.HasAttributeOfType(typeof(ChartDivisionInfo), subDivisions.name, typeof(SimpleAttribute)))
+ continue;
+ }
+ EditorGUILayout.PropertyField(subDivisions);
+ }
+ EditorGUI.indentLevel--;
+ }
+ }
+ }
+}
diff --git a/Assets/Chart And Graph/Editor/AxisInspector.cs.meta b/Assets/Chart And Graph/Editor/AxisInspector.cs.meta
new file mode 100644
index 00000000..3c3e275e
--- /dev/null
+++ b/Assets/Chart And Graph/Editor/AxisInspector.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 898567b381452e94794158c16012f617
+timeCreated: 1479124371
+licenseType: Store
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Chart And Graph/Editor/BarChartInspetor.cs b/Assets/Chart And Graph/Editor/BarChartInspetor.cs
new file mode 100644
index 00000000..f95f8e52
--- /dev/null
+++ b/Assets/Chart And Graph/Editor/BarChartInspetor.cs
@@ -0,0 +1,364 @@
+#define Graph_And_Chart_PRO
+
+using ChartAndGraph;
+using System;
+using System.Collections.Generic;
+using UnityEditor;
+using UnityEngine;
+
+[CustomEditor(typeof(BarChart),true)]
+class BarChartInspetor : Editor
+{
+ bool mCategories = false;
+ bool mGroups = false;
+ string mCategoryError = null;
+ string mNewCategoryName = "";
+ string mNewGroupName = "";
+ string mGroupError = null;
+ GUIStyle mRedStyle;
+ GUIStyle mBold;
+ HashSet mAllNames = new HashSet();
+ GUIStyle mSplitter;
+ List mToRemove = new List();
+ List mToUp = new List();
+ Dictionary mOperations = new Dictionary();
+ ChartDataEditor mWindow;
+ bool mUpdateWindow = false;
+ Texture mSettings;
+ GUIContent MaxBarValue = new GUIContent("Max Bar Value :", "All the bars are scaled according to this value, Bars that are larger then this value are clamped");
+ GUIContent MinBarValue = new GUIContent("Min Bar Value :", "All the bars are scaled according to this value, Bars that are lower then this value are clamped");
+ RenameWindow mRenameWindow;
+ public void OnEnable()
+ {
+ mRedStyle = new GUIStyle();
+ mRedStyle.normal.textColor = Color.red;
+
+ mSplitter = new GUIStyle();
+ mSplitter.normal.background = EditorGUIUtility.whiteTexture;
+ mSplitter.stretchWidth = true;
+ mSplitter.margin = new RectOffset(0, 0, 7, 7);
+ }
+
+ public void Splitter()
+ {
+ Rect position = GUILayoutUtility.GetRect(GUIContent.none, mSplitter, GUILayout.Height(1f));
+ if (Event.current.type == EventType.Repaint)
+ {
+ Color restoreColor = GUI.color;
+ GUI.color = new Color(0.5f, 0.5f, 0.5f);
+ mSplitter.Draw(position, false, false, false, false);
+ GUI.color = restoreColor;
+ }
+ }
+
+ private void DoOperations(SerializedProperty items,int size,string type)
+ {
+ mToRemove.Clear();
+ mToUp.Clear();
+ bool up = false;
+ for (int i = 0; i < size; i++)
+ {
+ SerializedProperty entry = items.GetArrayElementAtIndex(i);
+ if (entry == null)
+ continue;
+ SerializedProperty nameProp = entry.FindPropertyRelative("Name");
+ string name = null;
+ if (nameProp == null)
+ name = entry.stringValue;
+ else
+ name = nameProp.stringValue;
+
+ string arg = type + "|" + name;
+ string res = null;
+ if (up == true)
+ {
+ mToUp.Add(i);
+ up = false;
+ }
+ if (mOperations.TryGetValue(arg, out res))
+ {
+ if (res == "remove")
+ mToRemove.Add(i);
+ if (res == "up" && i > 0)
+ mToUp.Add(i);
+ if (res == "down")
+ up = true;
+ mOperations.Remove(arg);
+ }
+ }
+ for (int i = 0; i < mToRemove.Count; i++)
+ items.DeleteArrayElementAtIndex(mToRemove[i]);
+ for (int i = 0; i < mToUp.Count; i++)
+ {
+ int cur = mToUp[i];
+ items.MoveArrayElement(cur, cur - 1);
+ }
+ }
+
+ private void NamedItemEditor(SerializedProperty data, string type, string property, string caption, ref string errorMessage, ref bool foldout, ref string newName)
+ {
+ SerializedProperty items = data.FindPropertyRelative(property);
+ items.isExpanded = EditorGUILayout.Foldout(items.isExpanded, caption);
+ //bool up, down;
+ mAllNames.Clear();
+ int size = items.arraySize;
+ if (Event.current.type == EventType.Layout)
+ DoOperations(items, size, type);
+ size = items.arraySize;
+ if (items.isExpanded)
+ {
+ EditorGUI.indentLevel++;
+ for (int i = 0; i < size; i++)
+ {
+ SerializedProperty entry = items.GetArrayElementAtIndex(i);
+ if (entry == null)
+ continue;
+ SerializedProperty nameProp = entry.FindPropertyRelative("Name");
+ string name = null;
+ if (nameProp == null)
+ name = entry.stringValue;
+ else
+ name = nameProp.stringValue;
+ mAllNames.Add(name);
+ EditorGUILayout.BeginHorizontal();
+ bool toogle = false;
+ if (nameProp != null)
+ toogle = entry.isExpanded = EditorGUILayout.Foldout(entry.isExpanded, name);
+ else
+ {
+ toogle = false;
+ EditorGUILayout.LabelField(name);
+ }
+ GUILayout.FlexibleSpace();
+ if(GUILayout.Button("..."))
+ DoContext(type, name);
+ EditorGUILayout.EndHorizontal();
+ if (toogle)
+ {
+
+ EditorGUI.indentLevel++;
+ if (nameProp != null)
+ {
+ SerializedProperty end = entry.GetEndProperty(true);
+ entry.Next(true);
+ if (SerializedProperty.EqualContents(entry, end) == false)
+ {
+ do
+ {
+ if (entry.name != "Name")
+ EditorGUILayout.PropertyField(entry, true);
+ }
+ while (entry.Next(entry.name == "Materials") && SerializedProperty.EqualContents(entry, end) == false);
+ }
+ }
+ EditorGUI.indentLevel--;
+ }
+
+
+ }
+
+ if (errorMessage != null)
+ EditorGUILayout.LabelField(errorMessage, mRedStyle);
+ EditorGUILayout.LabelField(string.Format("Add new {0} :", type));
+ //Rect indentAdd = EditorGUI.IndentedRect(new Rect(0f, 0f, 1000f, 1000f));
+ EditorGUILayout.BeginHorizontal();
+ newName = EditorGUILayout.TextField(newName);
+ //GUILayout.Space(indentAdd.xMin);
+ if (GUILayout.Button("Add"))
+ {
+ bool error = false;
+ if (newName.Trim().Length == 0)
+ {
+ errorMessage = "Name can't be empty";
+ error = true;
+ }
+ else if (ChartEditorCommon.IsAlphaNum(newName) == false)
+ {
+ errorMessage = "Name conatins invalid characters";
+ error = true;
+ }
+ else if (mAllNames.Contains(newName))
+ {
+ errorMessage = string.Format("A {0} named {1} already exists in this chart", type, newName);
+ error = true;
+ }
+ if (error == false)
+ {
+ errorMessage = null;
+ items.InsertArrayElementAtIndex(size);
+ SerializedProperty newItem = items.GetArrayElementAtIndex(size);
+ SerializedProperty newItemName = newItem.FindPropertyRelative("Name");
+ if (newItemName == null)
+ newItem.stringValue = newName;
+ else
+ newItemName.stringValue = newName;
+ newName = "";
+ UpdateWindow();
+ }
+ }
+ EditorGUILayout.EndHorizontal();
+ EditorGUI.indentLevel--;
+ }
+ else
+ {
+ errorMessage = null;
+ }
+ UpdateWindow();
+ }
+
+ void callback(object val)
+ {
+ KeyValuePair pair = (KeyValuePair)val;
+ mOperations[pair.Key] = pair.Value;
+ }
+
+ bool RenameGroup(string fromName, string toName)
+ {
+ BarChart barChart = (BarChart)serializedObject.targetObject;
+ try
+ {
+ barChart.DataSource.RenameGroup(fromName, toName);
+ }
+ catch (Exception)
+ {
+ return false;
+ }
+ serializedObject.Update();
+ if (barChart.gameObject.activeInHierarchy)
+ barChart.GenerateChart();
+ else
+ EditorUtility.SetDirty(barChart);
+ return true;
+ }
+
+ bool RenameCategory(string fromName,string toName)
+ {
+ BarChart barChart = (BarChart)serializedObject.targetObject;
+ try
+ {
+ barChart.DataSource.RenameCategory(fromName, toName);
+ }
+ catch(Exception)
+ {
+ return false;
+ }
+ serializedObject.Update();
+ if(barChart.gameObject.activeInHierarchy)
+ barChart.GenerateChart();
+ else
+ EditorUtility.SetDirty(barChart);
+ return true;
+ }
+ void RenameCalled(object val)
+ {
+ var data = (KeyValuePair)val;
+ RenameWindow window = EditorWindow.GetWindow();
+ mRenameWindow = window;
+ if(data.Key == "category")
+ window.ShowDialog(data.Value, data.Key, RenameCategory);
+ else if(data.Key == "group")
+ window.ShowDialog(data.Value, data.Key, RenameGroup);
+ }
+ void DoContext(string type,string name)
+ {
+ string arg = type + "|" + name;
+ GenericMenu menu = new GenericMenu();
+ menu.AddItem(new GUIContent("Move Up"), false,callback, new KeyValuePair(arg, "up"));
+ menu.AddItem(new GUIContent("Move Down"), false, callback, new KeyValuePair(arg, "down"));
+ menu.AddItem(new GUIContent("Remove"), false, callback, new KeyValuePair(arg, "remove"));
+ menu.AddItem(new GUIContent("Rename.."), false, RenameCalled, new KeyValuePair(type, name));
+
+ menu.ShowAsContext();
+ }
+ void UpdateWindow()
+ {
+ mUpdateWindow = true;
+ }
+ void OnDisable()
+ {
+ if(mRenameWindow != null)
+ {
+ mRenameWindow.Close();
+ mRenameWindow = null;
+ }
+ if (mWindow != null)
+ {
+ mWindow.Close();
+ mWindow = null;
+ }
+ }
+
+ public override void OnInspectorGUI()
+ {
+ base.OnInspectorGUI();
+ serializedObject.Update();
+ SerializedProperty barData = serializedObject.FindProperty("Data");
+ EditorGUILayout.BeginVertical();
+ Splitter();
+ if(mBold == null)
+ {
+ mBold = new GUIStyle(EditorStyles.foldout);
+ //mBold.fontStyle = FontStyle.Bold;
+ }
+ // EditorStyles.foldout.fontStyle = FontStyle.Bold;
+ // fold = EditorGUILayout.Foldout(fold,"Bar Data", EditorStyles.foldout);
+ //EditorStyles.foldout.fontStyle = FontStyle.Normal;
+ // if (fold)
+ // {
+ EditorGUILayout.LabelField("Data", EditorStyles.boldLabel);
+ EditorGUI.indentLevel++;
+ NamedItemEditor(barData, "category", "mCategories", "Categories", ref mCategoryError, ref mCategories, ref mNewCategoryName);
+ NamedItemEditor(barData, "group", "mGroups", "Groups", ref mGroupError, ref mGroups, ref mNewGroupName);
+
+ SerializedProperty maxProp = barData.FindPropertyRelative("maxValue");
+ SerializedProperty minProp = barData.FindPropertyRelative("minValue");
+
+ EditorGUILayout.BeginHorizontal();
+ EditorGUILayout.LabelField(MinBarValue, EditorStyles.boldLabel);
+ SerializedProperty automaticProp = barData.FindPropertyRelative("automaticMinValue");
+ bool automatic = automaticProp.boolValue;
+ automatic = GUILayout.Toggle(automatic, "Auto");
+ GUILayout.FlexibleSpace();
+ automaticProp.boolValue = automatic;
+ EditorGUILayout.EndHorizontal();
+ if (automatic == false)
+ {
+ EditorGUILayout.PropertyField(minProp);
+ if (minProp.doubleValue > maxProp.doubleValue)
+ minProp.doubleValue = maxProp.doubleValue - 0.1;
+ }
+ EditorGUILayout.BeginHorizontal();
+ EditorGUILayout.LabelField(MaxBarValue, EditorStyles.boldLabel);
+ automaticProp = barData.FindPropertyRelative("automaticMaxValue");
+ automatic = automaticProp.boolValue;
+ automatic = GUILayout.Toggle(automatic, "Auto");
+ GUILayout.FlexibleSpace();
+ automaticProp.boolValue = automatic;
+ EditorGUILayout.EndHorizontal();
+ if (automatic == false)
+ {
+
+ EditorGUILayout.PropertyField(maxProp);
+ if (minProp.doubleValue > maxProp.doubleValue)
+ maxProp.doubleValue = minProp.doubleValue + 0.1;
+ }
+
+ if (GUILayout.Button("Edit Values...") && mWindow == null)
+ mWindow = ChartDataEditor.ShowForObject(serializedObject);
+ //}
+ EditorGUI.indentLevel--;
+ EditorGUILayout.EndVertical();
+ serializedObject.ApplyModifiedProperties();
+
+ if (mUpdateWindow == true)
+ {
+ mUpdateWindow = false;
+ if (mWindow != null)
+ {
+ mWindow.SetEditedObject(serializedObject);
+ mWindow.Repaint();
+ }
+ }
+
+ }
+}
diff --git a/Assets/Chart And Graph/Editor/BarChartInspetor.cs.meta b/Assets/Chart And Graph/Editor/BarChartInspetor.cs.meta
new file mode 100644
index 00000000..68c11a6c
--- /dev/null
+++ b/Assets/Chart And Graph/Editor/BarChartInspetor.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 056f0fff5e172de468df8c3392cabaac
+timeCreated: 1473969758
+licenseType: Store
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Chart And Graph/Editor/CategoryDataEditor.cs b/Assets/Chart And Graph/Editor/CategoryDataEditor.cs
new file mode 100644
index 00000000..cb26d529
--- /dev/null
+++ b/Assets/Chart And Graph/Editor/CategoryDataEditor.cs
@@ -0,0 +1,68 @@
+#define Graph_And_Chart_PRO
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using UnityEditor;
+using UnityEngine;
+
+namespace ChartAndGraph
+{
+ [CustomPropertyDrawer(typeof(GraphDataFiller.CategoryData))]
+ class CategoryDataEditor : PropertyDrawer
+ {
+ public override float GetPropertyHeight(SerializedProperty property, GUIContent label)
+ {
+
+ return -2f;
+ }
+
+ public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
+ {
+ EditorGUI.BeginProperty(position, label, property);
+ var enabled = property.FindPropertyRelative("Enabled");
+
+ property.isExpanded = EditorGUILayout.Foldout(property.isExpanded, property.displayName);
+ if(property.isExpanded)
+ {
+ EditorGUI.indentLevel++;
+ EditorGUILayout.PropertyField(enabled);
+ if (enabled.boolValue == true)
+ {
+ var dataType = property.FindPropertyRelative("DataType");
+ EditorGUILayout.PropertyField(dataType);
+ int item = dataType.enumValueIndex;
+ var iterator = property.Copy();
+ var end = iterator.GetEndProperty();
+ bool hasNext = iterator.NextVisible(true);
+ Type t = typeof(GraphDataFiller.CategoryData);
+ while (hasNext)
+ {
+ if ((SerializedProperty.EqualContents(iterator, end)))
+ break;
+ bool show = false;
+
+ foreach (object attrb in t.GetField(iterator.name).GetCustomAttributes(false))
+ {
+ var cast = attrb as ChartFillerEditorAttribute;
+ if (cast != null)
+ {
+ if ((int)cast.ShowForType == item)
+ {
+ show = true;
+ break;
+ }
+ }
+ }
+ if (show)
+ EditorGUILayout.PropertyField(iterator);
+ // Debug.Log(iterator.displayName);
+ hasNext = iterator.NextVisible(false);
+ }
+ }
+ }
+ EditorGUI.indentLevel--;
+ EditorGUI.EndProperty();
+ }
+ }
+}
diff --git a/Assets/Chart And Graph/Editor/CategoryDataEditor.cs.meta b/Assets/Chart And Graph/Editor/CategoryDataEditor.cs.meta
new file mode 100644
index 00000000..75336ee0
--- /dev/null
+++ b/Assets/Chart And Graph/Editor/CategoryDataEditor.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: d7ad20a161538c146aa76559c3f89754
+timeCreated: 1536697084
+licenseType: Store
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Chart And Graph/Editor/CategoryLabelsInspector.cs b/Assets/Chart And Graph/Editor/CategoryLabelsInspector.cs
new file mode 100644
index 00000000..848bcaf0
--- /dev/null
+++ b/Assets/Chart And Graph/Editor/CategoryLabelsInspector.cs
@@ -0,0 +1,26 @@
+#define Graph_And_Chart_PRO
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using UnityEditor;
+
+namespace ChartAndGraph
+{
+ [CustomEditor(typeof(CategoryLabels))]
+ class CategoryLabelsLabelsInspector : ItemLabelsBaseEditor
+ {
+ protected override string Name
+ {
+ get
+ {
+ return "category labels";
+ }
+ }
+
+ protected override bool isSupported(AnyChart chart)
+ {
+ return ((IInternalUse)chart).InternalSupportsCategoryLables;
+ }
+ }
+}
diff --git a/Assets/Chart And Graph/Editor/CategoryLabelsInspector.cs.meta b/Assets/Chart And Graph/Editor/CategoryLabelsInspector.cs.meta
new file mode 100644
index 00000000..b8fcd661
--- /dev/null
+++ b/Assets/Chart And Graph/Editor/CategoryLabelsInspector.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 31ece195e6c596940a2dd7720c53058e
+timeCreated: 1480254476
+licenseType: Store
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Chart And Graph/Editor/ChartDataEditor.cs b/Assets/Chart And Graph/Editor/ChartDataEditor.cs
new file mode 100644
index 00000000..7240cb27
--- /dev/null
+++ b/Assets/Chart And Graph/Editor/ChartDataEditor.cs
@@ -0,0 +1,96 @@
+#define Graph_And_Chart_PRO
+using System.Collections.Generic;
+using UnityEditor;
+using UnityEngine;
+
+public class ChartDataEditor : UnityEditor.EditorWindow
+{
+ SerializedObject mEditedObject;
+ SerializedProperty mBarData;
+ SerializedProperty mCategories;
+ SerializedProperty mGroups;
+ SerializedProperty mData;
+ Dictionary mValues;
+
+ public static ChartDataEditor ShowForObject(SerializedObject obj)
+ {
+ ChartDataEditor window = (ChartDataEditor)EditorWindow.GetWindow(typeof(ChartDataEditor));
+ window.SetEditedObject(obj);
+ return window;
+ }
+
+ public void SetEditedObject(SerializedObject obj)
+ {
+ mEditedObject = obj;
+ mBarData = mEditedObject.FindProperty("Data");
+ mCategories = mBarData.FindPropertyRelative("mCategories");
+ mGroups = mBarData.FindPropertyRelative("mGroups");
+ mData = mBarData.FindPropertyRelative("mData");
+ LoadData();
+
+
+ }
+
+ void LoadData()
+ {
+ if(mValues == null)
+ mValues = new Dictionary();
+ mValues.Clear();
+ int size = mData.arraySize;
+ for (int i = 0; i < size; i++)
+ {
+ SerializedProperty prop = mData.GetArrayElementAtIndex(i);
+ string columnName = prop.FindPropertyRelative("ColumnName").stringValue;
+ string rowName = prop.FindPropertyRelative("GroupName").stringValue;
+ SerializedProperty amount = prop.FindPropertyRelative("Amount");
+ string keyName = getKey(columnName, rowName);
+ mValues[keyName] = amount;
+ }
+ }
+
+ string getKey(string column,string row)
+ {
+ return string.Format("{0}|{1}", column, row);
+ }
+
+ void OnGUI()
+ {
+ GUILayout.Label("Edit Values", EditorStyles.boldLabel);
+ GUILayout.BeginVertical();
+ int categoryCount = mCategories.arraySize;
+ int groupCount = mGroups.arraySize;
+ GUILayout.BeginHorizontal();
+
+ GUILayout.Label(" ",GUILayout.Width(EditorGUIUtility.fieldWidth));
+ for (int i = 0; i < groupCount; i++)
+ {
+ string group = mGroups.GetArrayElementAtIndex(i).stringValue;
+ GUILayout.Label(group, GUILayout.Width(EditorGUIUtility.fieldWidth));
+ }
+ GUILayout.EndHorizontal();
+ for (int i=0; i 0;
+ }
+
+ }
+}
diff --git a/Assets/Chart And Graph/Editor/ChartEditorCommon.cs.meta b/Assets/Chart And Graph/Editor/ChartEditorCommon.cs.meta
new file mode 100644
index 00000000..7adad71e
--- /dev/null
+++ b/Assets/Chart And Graph/Editor/ChartEditorCommon.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 7fc5bc09e01eda34da606695525bf023
+timeCreated: 1479124371
+licenseType: Store
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Chart And Graph/Editor/ChartOrientedSizeInspector.cs b/Assets/Chart And Graph/Editor/ChartOrientedSizeInspector.cs
new file mode 100644
index 00000000..a2e0696b
--- /dev/null
+++ b/Assets/Chart And Graph/Editor/ChartOrientedSizeInspector.cs
@@ -0,0 +1,58 @@
+#define Graph_And_Chart_PRO
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using UnityEditor;
+using ChartAndGraph;
+using UnityEngine;
+
+[CustomPropertyDrawer(typeof(ChartOrientedSize))]
+class ChartOrientedSizeInspector : PropertyDrawer
+{
+ public override float GetPropertyHeight(SerializedProperty property, GUIContent label)
+ {
+ return EditorGUIUtility.singleLineHeight * 2;
+ }
+
+ void DoField(SerializedProperty prop, string label, Rect position)
+ {
+ float size = GUI.skin.label.CalcSize(new GUIContent(label)).x;
+ Rect labelRect = new Rect(position.x, position.y, size, position.height);
+ Rect FieldRect = new Rect(labelRect.xMax, position.y, position.width - size, position.height);
+ EditorGUI.LabelField(labelRect, label);
+ float val = prop.floatValue;
+ EditorGUI.LabelField(labelRect, label);
+ float labelWidth = EditorGUIUtility.labelWidth;
+ EditorGUIUtility.labelWidth = 5;
+ val = EditorGUI.FloatField(FieldRect, " ", val);
+ EditorGUIUtility.labelWidth = labelWidth;
+ prop.floatValue = val;
+ }
+
+ public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
+ {
+
+ label = EditorGUI.BeginProperty(position, label, property);
+ EditorGUI.PrefixLabel(position, GUIUtility.GetControlID(FocusType.Passive), label);
+
+ position = EditorGUI.IndentedRect(position);
+
+ float halfWidth = position.width *0.5f;
+ float y = position.y + EditorGUIUtility.singleLineHeight;
+ float height = position.height - EditorGUIUtility.singleLineHeight;
+ Rect breadthRect = new Rect(position.x, y, halfWidth, height);
+ Rect depthRect = new Rect(breadthRect.xMax, y, halfWidth, height);
+
+ int indent = EditorGUI.indentLevel;
+ EditorGUI.indentLevel=0;
+ SerializedProperty breadth = property.FindPropertyRelative("Breadth");
+ SerializedProperty depth = property.FindPropertyRelative("Depth");
+ DoField(breadth, "Breadth:", breadthRect);
+ DoField(depth, "Depth:", depthRect);
+ EditorGUI.indentLevel = indent;
+ // EditorGUILayout.EndVertical();
+ EditorGUI.EndProperty();
+ }
+}
+
diff --git a/Assets/Chart And Graph/Editor/ChartOrientedSizeInspector.cs.meta b/Assets/Chart And Graph/Editor/ChartOrientedSizeInspector.cs.meta
new file mode 100644
index 00000000..eb117ebe
--- /dev/null
+++ b/Assets/Chart And Graph/Editor/ChartOrientedSizeInspector.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 6f48c9091dc0c084595117abe8222c22
+timeCreated: 1473684701
+licenseType: Store
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Chart And Graph/Editor/EditorMenu.Full.cs b/Assets/Chart And Graph/Editor/EditorMenu.Full.cs
new file mode 100644
index 00000000..5e5c7eb0
--- /dev/null
+++ b/Assets/Chart And Graph/Editor/EditorMenu.Full.cs
@@ -0,0 +1,60 @@
+#define Graph_And_Chart_PRO
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using UnityEditor;
+using UnityEngine;
+
+namespace ChartAndGraph
+{
+
+ partial class EditorMenu
+ {
+ private static void InstanciateWorldSpace(string path)
+ {
+ GameObject obj = Resources.Load(path);
+ // GameObject obj = AssetDatabase.LoadAssetAtPath(path);
+ GameObject newObj = (GameObject)GameObject.Instantiate(obj);
+ newObj.name = newObj.name.Replace("(Clone)", "");
+ Undo.RegisterCreatedObjectUndo(newObj, "Create Object");
+ }
+
+ [MenuItem("Tools/Charts/Radar/3D")]
+ public static void AddRadarChartWorldSpace()
+ {
+ InstanciateWorldSpace("MenuPrefabs/3DRadar");
+ }
+
+ [MenuItem("Tools/Charts/Bar/3D/Simple")]
+ public static void AddBarChartSimple3D()
+ {
+ InstanciateWorldSpace("MenuPrefabs/Bar3DSimple");
+ }
+
+ [MenuItem("Tools/Charts/Bar/3D/Multiple Groups")]
+ public static void AddBarChartMultiple3D()
+ {
+ InstanciateWorldSpace("MenuPrefabs/Bar3DMultiple");
+ }
+
+ [MenuItem("Tools/Charts/Torus/3D")]
+ public static void AddTorusChart3D()
+ {
+ InstanciateWorldSpace("MenuPrefabs/Torus3D");
+ }
+
+ [MenuItem("Tools/Charts/Pie/3D")]
+ public static void AddPieChart3D()
+ {
+ InstanciateWorldSpace("MenuPrefabs/Pie3D");
+ }
+
+ [MenuItem("Tools/Charts/Graph/3D")]
+ public static void AddGraph3D()
+ {
+ InstanciateWorldSpace("MenuPrefabs/3DGraph");
+ }
+
+ }
+}
diff --git a/Assets/Chart And Graph/Editor/EditorMenu.Full.cs.meta b/Assets/Chart And Graph/Editor/EditorMenu.Full.cs.meta
new file mode 100644
index 00000000..0bc0760b
--- /dev/null
+++ b/Assets/Chart And Graph/Editor/EditorMenu.Full.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 128e6b85597fded4f886f1f5aea62b53
+timeCreated: 1560597478
+licenseType: Store
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Chart And Graph/Editor/EditorMenu.cs b/Assets/Chart And Graph/Editor/EditorMenu.cs
new file mode 100644
index 00000000..03fdb6f8
--- /dev/null
+++ b/Assets/Chart And Graph/Editor/EditorMenu.cs
@@ -0,0 +1,113 @@
+#define Graph_And_Chart_PRO
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using UnityEditor;
+using UnityEngine;
+
+namespace ChartAndGraph
+{
+ partial class EditorMenu
+ {
+ private static void InstanciateCanvas(string path)
+ {
+ Canvas[] canvases = GameObject.FindObjectsOfType