private void UpdateView()
        {
            if (labelText == null || lineRenderer == null)
            {
                return;
            }

            labelText.SetLabelText(Label);
            labelText.SetLabelColor(IndicatorColor);
            labelText.SetLabelTextSize(FontSize);

            lineRenderer.Points = LinePoints.ToArray();
            lineRenderer.color  = IndicatorColor;

            if (ReversedLabel)
            {
                labelText.SetLabelTextAlignment(TextAnchor.MiddleRight);
                labelText.GetComponent <RectTransform> ().pivot = PivotValue.MIDDLE_RIGHT;
            }
            else
            {
                labelText.SetLabelTextAlignment(TextAnchor.MiddleLeft);
                labelText.GetComponent <RectTransform> ().pivot = PivotValue.MIDDLE_LEFT;
            }
        }
Esempio n. 2
0
 private void UpdateLabel(ChartLabel label,
                          AxisLabelConfig config,
                          AxisLabelRendererExtry entry,
                          Vector2 rendererSize)
 {
     label.SetLabelColor(config.LabelColor);
     label.SetLabelTextSize(config.LabelSize);
     label.SetLabelTextAlignment(GetLabelAlignment(entry));
     label.SetLabelText(entry.Text);
     label.GetComponent <RectTransform> ().pivot = GetLabelPivot(entry);
     label.transform.localPosition = CreateLabelPositionForEntry(entry, rendererSize, config.LabelMargin);
 }