private void UpdateContext(ParallelAxis axis) { var parallel = chart.GetChartComponent <ParallelCoord>(axis.parallelIndex); if (parallel == null) { return; } m_Orient = parallel.orient; m_Parallel = parallel; var axisCount = chart.GetChartComponentNum <ParallelAxis>(); if (m_Orient == Orient.Horizonal) { var each = axisCount > 1 ? parallel.context.height / (axisCount - 1) : 0; axis.context.x = parallel.context.x; axis.context.y = parallel.context.y + (axis.index) * each; axis.context.width = parallel.context.width; } else { var each = axisCount > 1 ? parallel.context.width / (axisCount - 1) : 0; axis.context.x = parallel.context.x + (axis.index) * each; axis.context.y = parallel.context.y; axis.context.width = parallel.context.height; } axis.context.orient = m_Orient; axis.context.height = 0; axis.context.position = new Vector3(axis.context.x, axis.context.y); }
private static ParallelAxis GetAxis(ParallelCoord parallel, int index) { if (index >= 0 && index < parallel.context.parallelAxes.Count) { return(parallel.context.parallelAxes[index]); } else { return(null); } }
private static Vector3 GetPos(ParallelCoord parallel, int axisIndex, double dataValue, bool isHorizonal) { var axis = GetAxis(parallel, axisIndex); if (axis == null) { return(Vector3.zero); } var sValueDist = axis.GetDistance(dataValue, axis.context.width); return(new Vector3( isHorizonal ? axis.context.x + sValueDist : axis.context.x, isHorizonal ? axis.context.y : axis.context.y + sValueDist)); }