本文整理汇总了C#中Visifire.Charts.Axis.PixelPositionToYValue方法的典型用法代码示例。如果您正苦于以下问题:C# Axis.PixelPositionToYValue方法的具体用法?C# Axis.PixelPositionToYValue怎么用?C# Axis.PixelPositionToYValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Visifire.Charts.Axis
的用法示例。
在下文中一共展示了Axis.PixelPositionToYValue方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CalculateInternalYValueFromPixelPos
/// <summary>
/// Calculate internalYValue from mouse pointer position
/// </summary>
/// <param name="chart">Chart</param>
/// <param name="yAxis">y-axis reference</param>
/// <param name="e">MouseEventArgs</param>
/// <returns>Double internalYValue</returns>
internal static Double CalculateInternalYValueFromPixelPos(Chart chart, Axis yAxis, MouseEventArgs e)
{
AxisOrientation axisOrientation = yAxis.AxisOrientation;
Double pixelPosition = (axisOrientation == AxisOrientation.Vertical) ? e.GetPosition(chart.ChartArea.PlottingCanvas).Y : e.GetPosition(chart.ChartArea.PlottingCanvas).X;
Double lengthInPixel = ((axisOrientation == AxisOrientation.Vertical) ? chart.ChartArea.ChartVisualCanvas.Height : chart.ChartArea.ChartVisualCanvas.Width);
return yAxis.PixelPositionToYValue(lengthInPixel, (axisOrientation == AxisOrientation.Vertical) ? pixelPosition : lengthInPixel - pixelPosition);
}
示例2: SetPlotAreaMouseEventArgs4AxesY
private void SetPlotAreaMouseEventArgs4AxesY(Chart chart, Axis axis, MouseEventArgs e, PlotAreaMouseEventArgs eventArgs)
{
Double yValue;
AxisOrientation axisOrientation = axis.AxisOrientation;
Double pixelPosition = (axisOrientation == AxisOrientation.Vertical) ? e.GetPosition(chart.ChartArea.PlottingCanvas).Y : e.GetPosition(chart.ChartArea.PlottingCanvas).X;
Double lenthInPixel = ((axisOrientation == AxisOrientation.Vertical) ? chart.ChartArea.ChartVisualCanvas.Height : chart.ChartArea.ChartVisualCanvas.Width);
yValue = axis.PixelPositionToYValue(lenthInPixel, (axisOrientation == AxisOrientation.Vertical) ? pixelPosition : lenthInPixel - pixelPosition);
if (axis.Logarithmic)
eventArgs.YValue = DataPoint.ConvertLogarithmicValue2ActualValue(chart, yValue, axis.AxisType);
else
eventArgs.YValue = yValue;
}