private float GetDataPoint(bool isY, Axis axis, Axis relativedAxis, GridCoord grid, double xValue,
                                   double yValue, int i, float scaleWid, bool isStack, ref Vector3 np)
        {
            float xPos, yPos;
            var   gridXY = isY ? grid.context.x : grid.context.y;

            if (isY)
            {
                var valueHig = AxisHelper.GetAxisValueDistance(grid, relativedAxis, scaleWid, yValue);
                valueHig = AnimationStyleHelper.CheckDataAnimation(chart, serie, i, valueHig);

                xPos = gridXY + valueHig;
                yPos = AxisHelper.GetAxisValuePosition(grid, axis, scaleWid, xValue);
            }
            else
            {
                var valueHig = AxisHelper.GetAxisValueDistance(grid, relativedAxis, scaleWid, yValue);
                valueHig = AnimationStyleHelper.CheckDataAnimation(chart, serie, i, valueHig);

                yPos = gridXY + valueHig;
                xPos = AxisHelper.GetAxisValuePosition(grid, axis, scaleWid, xValue);
            }
            np = new Vector3(xPos, yPos);
            return(yPos);
        }
Ejemplo n.º 2
0
 private void UpdateXYPosition(GridCoord grid, bool isY, Axis axis, Axis relativedAxis, int i, float categoryWidth, float barWidth, bool isStack,
                               double value, ref float pX, ref float pY)
 {
     if (isY)
     {
         if (axis.IsCategory())
         {
             pY = grid.context.y + i * categoryWidth + (axis.boundaryGap ? 0 : -categoryWidth * 0.5f);
         }
         else
         {
             if (axis.context.minMaxRange <= 0)
             {
                 pY = grid.context.y;
             }
             else
             {
                 var valueLen = (float)((value - axis.context.minValue) / axis.context.minMaxRange) * grid.context.height;
                 pY = grid.context.y + valueLen - categoryWidth * 0.5f;
             }
         }
         pX = AxisHelper.GetAxisValuePosition(grid, relativedAxis, categoryWidth, 0);
         if (isStack)
         {
             for (int n = 0; n < m_StackSerieData.Count - 1; n++)
             {
                 pX += m_StackSerieData[n][i].context.stackHeight;
             }
         }
     }
     else
     {
         if (axis.IsCategory())
         {
             pX = grid.context.x + i * categoryWidth + (axis.boundaryGap ? 0 : -categoryWidth * 0.5f);
         }
         else
         {
             if (axis.context.minMaxRange <= 0)
             {
                 pX = grid.context.x;
             }
             else
             {
                 var valueLen = (float)((value - axis.context.minValue) / axis.context.minMaxRange) * grid.context.width;
                 pX = grid.context.x + valueLen - categoryWidth * 0.5f;
             }
         }
         pY = AxisHelper.GetAxisValuePosition(grid, relativedAxis, categoryWidth, 0);
         if (isStack)
         {
             for (int n = 0; n < m_StackSerieData.Count - 1; n++)
             {
                 pY += m_StackSerieData[n][i].context.stackHeight;
             }
         }
     }
 }
Ejemplo n.º 3
0
        private float GetDataPoint(bool isY, Axis axis, Axis relativedAxis, GridCoord grid, double xValue,
                                   double yValue, int i, float scaleWid, bool isStack, ref Vector3 np)
        {
            float xPos, yPos;
            var   gridXY   = isY ? grid.context.x : grid.context.y;
            var   valueHig = 0f;

            if (isY)
            {
                valueHig = AxisHelper.GetAxisValueDistance(grid, relativedAxis, scaleWid, yValue);
                valueHig = AnimationStyleHelper.CheckDataAnimation(chart, serie, i, valueHig);

                xPos = gridXY + valueHig;
                yPos = AxisHelper.GetAxisValuePosition(grid, axis, scaleWid, xValue);

                if (isStack)
                {
                    for (int n = 0; n < m_StackSerieData.Count - 1; n++)
                    {
                        xPos += m_StackSerieData[n][i].context.stackHeight;
                    }
                }
            }
            else
            {
                valueHig = AxisHelper.GetAxisValueDistance(grid, relativedAxis, scaleWid, yValue);
                valueHig = AnimationStyleHelper.CheckDataAnimation(chart, serie, i, valueHig);

                yPos = gridXY + valueHig;
                xPos = AxisHelper.GetAxisValuePosition(grid, axis, scaleWid, xValue);

                if (isStack)
                {
                    for (int n = 0; n < m_StackSerieData.Count - 1; n++)
                    {
                        yPos += m_StackSerieData[n][i].context.stackHeight;
                    }
                }
            }
            np = new Vector3(xPos, yPos);
            return(valueHig);
        }
Ejemplo n.º 4
0
 private void UpdateXYPosition(GridCoord grid, bool isY, Axis axis, Axis relativedAxis, int i, float categoryWidth, float barWidth,
                               double value, ref float pX, ref float pY)
 {
     if (isY)
     {
         if (axis.IsCategory())
         {
             pY = grid.context.y + i * categoryWidth + (axis.boundaryGap ? 0 : -categoryWidth * 0.5f);
         }
         else
         {
             if (axis.context.minMaxRange <= 0)
             {
                 pY = grid.context.y;
             }
             else
             {
                 pY = grid.context.y + (float)((value - axis.context.minValue) / axis.context.minMaxRange) * (grid.context.height - barWidth);
             }
         }
         pX = AxisHelper.GetAxisValuePosition(grid, relativedAxis, categoryWidth, 0);
     }
     else
     {
         if (axis.IsCategory())
         {
             pX = grid.context.x + i * categoryWidth + (axis.boundaryGap ? 0 : -categoryWidth * 0.5f);
         }
         else
         {
             if (axis.context.minMaxRange <= 0)
             {
                 pX = grid.context.x;
             }
             else
             {
                 pX = grid.context.x + (float)((value - axis.context.minValue) / axis.context.minMaxRange) * (grid.context.width - barWidth);
             }
         }
         pY = AxisHelper.GetAxisValuePosition(grid, relativedAxis, categoryWidth, 0);
     }
 }