Skip to content

ChartDataEntryDrawer

ClassChartGuruChartGuru.Editor
[CustomPropertyDrawer(typeof(ChartDataEntry))]
public class ChartDataEntryDrawer : PropertyDrawer

Property drawer for ChartGuru.ChartDataEntry that adapts the X editor to the connected chart’s axis type: • Numeric → standard float field (with Has Explicit X toggle) • Time → DateTime picker that converts to seconds since the Unix epoch via TimeAxisHelper.AxisSeconds(DateTime); auto-sets HasExplicitX • Categorical → hides numeric X entirely (label drives positioning) • Auto / Logarithmic → standard float field

Resolves the axis type by walking from the SerializedProperty’s target object (the host MonoBehaviour, typically ManualChartDataSource) to its TargetChart’s serialized X-axis scale-type field.

GetPropertyHeight(SerializedProperty, GUIContent)

Section titled “GetPropertyHeight(SerializedProperty, GUIContent)”
public override float GetPropertyHeight(SerializedProperty property, GUIContent label)

Override this method to specify how tall the GUI for this field is in pixels.

Parameters

Name Type Description
property UnityEditor.SerializedProperty The SerializedProperty to make the custom GUI for.
label UnityEngine.GUIContent The label of this property.

Returns

System.Single —

The height in pixels.

OnGUI(Rect, SerializedProperty, GUIContent)

Section titled “OnGUI(Rect, SerializedProperty, GUIContent)”
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)

Override this method to make your own IMGUI based GUI for the property.

Parameters

Name Type Description
position UnityEngine.Rect Rectangle on the screen to use for the property GUI.
property UnityEditor.SerializedProperty The SerializedProperty to make the custom GUI for.
label UnityEngine.GUIContent The label of this property.