コード例 #1
0
        /// <summary>
        /// Switching axes
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void MenuItem_Click_1(object sender, RoutedEventArgs e)
        {
            double xmin  = Xmin;
            double ymin  = Ymin;
            double xmax  = Xmax;
            double ymax  = Ymax;
            double xtick = XTick;
            double ytick = YTick;

            Xmin  = ymin;
            Xmax  = ymax;
            Ymin  = xmin;
            Ymax  = xmax;
            XTick = ytick;
            YTick = xtick;


            string lab = XLabel.ToString();

            XLabel = YLabel.ToString();
            YLabel = lab.ToString();

            foreach (LineSeries d in DataCollection)
            {
                d.LinePoints = new BindableCollection <Point>(d.LinePoints.Select(x => new Point(x.Y, x.X)).ToList());
            }

            DataCollection.UpdateChart();
        }
コード例 #2
0
    void ScaleGraph(float scale)
    {
        /*
         * Set the axes and labels
         */

        xRange[0] = -scale / 25f;  xRange[1] = scale / 25f;

        yRange[0] = -scale * yx_ratio / 25f;  yRange[1] = scale * yx_ratio / 25f;

        zRange[0] = 0; zRange[1] = 2 * scale * yx_ratio / 25f;

        GameObject.Find("MapImage").transform.localPosition = new Vector3(0, -yx_ratio * scale / 25f, yx_ratio * scale / 25f);
        // For now the Z range = Y range

        XLabel.transform.parent = transform;
        YLabel.transform.parent = transform;
        ZLabel.transform.parent = transform;
        xAxis.transform.parent  = transform;
        yAxis.transform.parent  = transform;
        zAxis.transform.parent  = transform;

        xAxis.transform.localPosition    = new Vector3(0, -yx_ratio * scale / 25f, 0);
        xAxis.transform.localEulerAngles = new Vector3(0, 0, 90);
        xAxis.transform.localScale       = new Vector3(0.05f, scale / 25f, 0.05f);

        yAxis.transform.localPosition = new Vector3(-scale / 25f, 0, 0);
        yAxis.transform.localScale    = new Vector3(0.05f, yx_ratio * scale / 25f, 0.05f);

        zAxis.transform.localPosition    = new Vector3(-scale / 25f, -yx_ratio * scale / 25f, yx_ratio * scale / 25f);
        zAxis.transform.localEulerAngles = new Vector3(90, 0, 0);
        zAxis.transform.localScale       = new Vector3(0.05f, yx_ratio * scale / 25f, 0.05f);

        XLabel.GetComponent <TextMesh>().anchor    = TextAnchor.MiddleCenter;
        XLabel.GetComponent <TextMesh>().fontStyle = FontStyle.Bold;
        YLabel.GetComponent <TextMesh>().anchor    = TextAnchor.MiddleCenter;
        YLabel.GetComponent <TextMesh>().fontStyle = FontStyle.Bold;
        ZLabel.GetComponent <TextMesh>().anchor    = TextAnchor.MiddleCenter;
        ZLabel.GetComponent <TextMesh>().fontStyle = FontStyle.Bold;

        XLabel.transform.localPosition = new Vector3(0, -scale * yx_ratio / 25f - 0.6f, 0);
        YLabel.transform.localPosition = new Vector3(-scale / 25f - 0.9f, 0, 0);
        ZLabel.transform.localPosition = new Vector3(-scale / 25f - 0.9f, -scale * yx_ratio / 25f - 0.4f, scale * yx_ratio / 25f);

        XLabel.transform.localScale = new Vector3(.02f, .02f, .02f);
        YLabel.transform.localScale = new Vector3(.02f, .02f, .02f);
        ZLabel.transform.localScale = new Vector3(.02f, .02f, .02f);
        YLabel.transform.Rotate(new Vector3(0, 0, 90));

        float pointSize = scale / 750f;

        DataPoint0.transform.localScale = new Vector3(pointSize, scale * yx_ratio / 25f, pointSize);
        DataPoint1.transform.localScale = new Vector3(pointSize, pointSize, pointSize);
        DataPoint2.transform.localScale = new Vector3(pointSize, pointSize, pointSize);
    }
コード例 #3
0
ファイル: ChartBase.cs プロジェクト: ekrogh/skia-chart
        /// <summary>
        /// Gets the Y-Axis Label given the corresponding floatin point value
        /// for that axis.
        /// </summary>
        /// <param name="labelValue">Floating point number representation of label</param>
        /// <returns></returns>
        public string GetYLabel(float labelValue)
        {
            if (YLabel == null || !YLabel.Any())
            {
                return(string.Format("{0, 9}", labelValue.ToString("N2")));
            }

            var index = int.Parse(Math.Round(labelValue, 0).ToString());

            return(YLabel[index]);
        }
コード例 #4
0
 /// <summary>
 /// Inicializar dados escalonados.
 /// </summary>
 /// <param name="processes">Processes.</param>
 private void SetUtilizationData(List <PlotableProcess> processes)
 {
     for (int index = 0; index < processes.Count; index++)
     {
         PlotableProcess process = processes[index];
         IntervalBarItem item    = new IntervalBarItem
         {
             Start         = process.ExecTime - 0.5f,
             End           = process.ExecTime + 0.5f,
             CategoryIndex = YLabel.IndexOf(process.name),
             //Title = process.Name,
             Color = process.attColor,
         };
         intervalBarSeries.Items.Add(item);
     }
 }
コード例 #5
0
    void ScaleGraph(float scale)
    {
        /*
         * Set the axes and labels
         */

        xRange[0] = -scale / 25f;  xRange[1] = scale / 25f;

        yRange[0] = -scale * yx_ratio / 25f;  yRange[1] = scale * yx_ratio / 25f;


        XLabel.transform.parent = transform;
        YLabel.transform.parent = transform;
        xAxis.transform.parent  = transform;
        yAxis.transform.parent  = transform;

        xAxis.transform.localPosition    = new Vector3(0, -yx_ratio * scale / 25f, 0);
        xAxis.transform.localEulerAngles = new Vector3(0, 0, 90);
        xAxis.transform.localScale       = new Vector3(0.05f, scale / 25f, 0.05f);
        // 150: Pos (-1.6, 4.6, 0.0); Scale (8250.0, 50.0, 50.0); 250: Pos (-1.6, -1.8, 0.0); Scale (13750.0, 50.0, 50.0)

        yAxis.transform.localPosition = new Vector3(-scale / 25f, 0, 0);
        yAxis.transform.localScale    = new Vector3(0.05f, yx_ratio * scale / 25f, 0.05f);
        //Debug.Log("YAxis: Pos " + yAxis.transform.position.x + ", " + yAxis.transform.position.y + ", " + yAxis.transform.position.z + "; Scale " + +yAxis.transform.localScale.x + ", " + yAxis.transform.localScale.y + ", " + yAxis.transform.localScale.z);
        // 150:  Pos (-8.9, 11.2, 0.0); Scale (50.0, 3750.0, 50.0); 250: Pos (-13.7, 9.25, 0.0); Scale (50.0, 6250.0, 50.0)
        XLabel.GetComponent <TextMesh>().anchor    = TextAnchor.MiddleCenter;
        XLabel.GetComponent <TextMesh>().fontStyle = FontStyle.Bold;
        YLabel.GetComponent <TextMesh>().anchor    = TextAnchor.MiddleCenter;
        YLabel.GetComponent <TextMesh>().fontStyle = FontStyle.Bold;

        XLabel.transform.localPosition = new Vector3(0, -scale * yx_ratio / 25f - 0.6f, 0);
        YLabel.transform.localPosition = new Vector3(-scale / 25f - 0.9f, 0, 0);
        XLabel.transform.localScale    = new Vector3(.02f, .02f, .02f);
        YLabel.transform.localScale    = new Vector3(.02f, .02f, .02f);
        YLabel.transform.Rotate(new Vector3(0, 0, 90));

        float pointSize = scale / 750f;

        DataPoint0.transform.localScale = new Vector3(pointSize, pointSize, pointSize);
        DataPoint1.transform.localScale = new Vector3(pointSize, pointSize, pointSize);
        DataPoint2.transform.localScale = new Vector3(pointSize, pointSize, pointSize);
    }