// call before using anything else! public void Init(WMG_Axis_Graph graph) { this.graph = graph; positioning = new GraphPositioning(graph as WMG_Graph_Manager); xAxis = new AxisFormatting(graph.xAxis); yAxis = new AxisFormatting(graph.yAxis); }
// sets the placeholder transform to the graph, then destroys the placeholder public void SetPlaceAndDestroyHolder(GraphPositioning positioning, GraphAppearance appearance) { // find placeholder PlaceholderController placeholder = transform.GetComponentInChildren <PlaceholderController>(); // assign offsets as placeholder offsets positioning.SetAllVariables( anchorMin: new Vector2(0, 0), anchorMax: new Vector2(1, 1), anchoredPosition: new Vector2(0.5f, 0.5f), offsetMin: placeholder.GetOffsetMin(), offsetMax: placeholder.GetOffsetMax()); // apply placeholder colors to graph appearance appearance.SetAllVariables( backgroundColor: placeholder.background.color, detailColor: placeholder.text.color); // remove placeholder GameObject.Destroy(placeholder.gameObject); }
public void Init(WMG_Pie_Graph graph) { this.graph = graph; positioning = new GraphPositioning(graph as WMG_Graph_Manager); }