当前位置: 首页>>代码示例>>C#>>正文


C# DataPoint.GetValue方法代码示例

本文整理汇总了C#中Visifire.Charts.DataPoint.GetValue方法的典型用法代码示例。如果您正苦于以下问题:C# DataPoint.GetValue方法的具体用法?C# DataPoint.GetValue怎么用?C# DataPoint.GetValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Visifire.Charts.DataPoint的用法示例。


在下文中一共展示了DataPoint.GetValue方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CreateLabelForDataPoint

        /// <summary>
        /// Create labels for DataPoint
        /// </summary>
        /// <param name="dataPoint">DataPoint</param>
        /// <returns>Border</returns>
        private static Border CreateLabelForDataPoint(DataPoint dataPoint, Boolean isStreamLine, Int32 sliceIndex)
        {
            Title title = new Title()
            {
                IsNotificationEnable = false,
                Chart = dataPoint.Chart,
                Text = dataPoint.TextParser(dataPoint.LabelText),
                InternalFontSize = (Double)dataPoint.LabelFontSize,
                InternalFontColor = (isStreamLine && sliceIndex == 0) ? Chart.CalculateDataPointLabelFontColor(dataPoint.Chart as Chart, dataPoint, null, LabelStyles.OutSide) : Chart.CalculateDataPointLabelFontColor(dataPoint.Chart as Chart, dataPoint, dataPoint.LabelFontColor, (LabelStyles)dataPoint.LabelStyle),
                InternalFontFamily = dataPoint.LabelFontFamily,
                InternalFontStyle = (FontStyle)dataPoint.LabelFontStyle,
                InternalFontWeight = (FontWeight)dataPoint.LabelFontWeight,
                InternalBackground = dataPoint.LabelBackground
            };

            // If its a StreamLine funnel then default size of the Title should be a bit bigger 
            if (isStreamLine && sliceIndex == 0 && dataPoint.GetValue(DataPoint.LabelFontSizeProperty) == null && dataPoint.Parent.GetValue(DataPoint.LabelFontSizeProperty) == null)
            {
                title.InternalFontSize = 11.5;
            }

            title.CreateVisualObject(new ElementData() { Element = dataPoint });

            if (!(Boolean)dataPoint.LabelEnabled)
                title.Visual.Visibility = Visibility.Collapsed;

            return title.Visual;
        }
开发者ID:zhangzy0193,项目名称:visifire,代码行数:33,代码来源:FunnelChart.cs

示例2: UpdateDataPoint

        private static void UpdateDataPoint(DataPoint dataPoint, VcProperties property, object newValue)
        {
            if (property != VcProperties.Enabled)
            {
                if (dataPoint.Parent.Enabled == false || (Boolean)dataPoint.Enabled == false)
                {
                    return;
                }
            }

            Chart chart = dataPoint.Chart as Chart;

            if (chart == null)
                return;

            Marker marker = dataPoint.Marker;
            DataSeries dataSeries = dataPoint.Parent;
            PlotGroup plotGroup = dataSeries.PlotGroup;
            Double height = chart.ChartArea.ChartVisualCanvas.Height;
            Double width = chart.ChartArea.ChartVisualCanvas.Width;
            Double xPosition, yPosition;
            Canvas line2dLabelCanvas = null;

            xPosition = Graphics.ValueToPixelPosition(0, width, (Double)plotGroup.AxisX.InternalAxisMinimum, (Double)plotGroup.AxisX.InternalAxisMaximum, dataPoint.InternalXValue);
            yPosition = Graphics.ValueToPixelPosition(height, 0, (Double)plotGroup.AxisY.InternalAxisMinimum, (Double)plotGroup.AxisY.InternalAxisMaximum, dataPoint.InternalYValue);

            if (dataSeries.Faces != null)
            {
                line2dLabelCanvas = dataSeries.Faces.LabelCanvas as Canvas;
                ColumnChart.UpdateParentVisualCanvasSize(chart, line2dLabelCanvas);
            }

            switch (property)
            {
                case VcProperties.Color:
                    if (marker != null && (Boolean)dataPoint.MarkerEnabled)
                        marker.BorderColor = (dataPoint.GetValue(DataPoint.MarkerBorderColorProperty) as Brush == null) ? ((newValue != null) ? newValue as Brush : dataPoint.MarkerBorderColor) : dataPoint.MarkerBorderColor;
                    break;
                case VcProperties.Cursor:
                    dataPoint.SetCursor2DataPointVisualFaces();
                    break;

                case VcProperties.Href:
                case VcProperties.HrefTarget:
                    dataPoint.SetHref2DataPointVisualFaces();
                    break;

                case VcProperties.LabelBackground:
                    //if (marker != null)
                    //    marker.TextBackground = dataPoint.LabelBackground;
                    CreateLabel4LineDataPoint(dataPoint, width, height, dataPoint.InternalYValue >= 0, xPosition, yPosition,
                        ref line2dLabelCanvas, true);
                    break;

                case VcProperties.LabelEnabled:
                    //if (marker.LabelEnabled == false)
                    //CreateMarkerAForLineDataPoint(dataPoint, width, height, ref line2dLabelCanvas, out xPosition, out yPosition);
                    //else
                    //    marker.LabelEnabled = (Boolean)dataPoint.LabelEnabled;
                    CreateLabel4LineDataPoint(dataPoint, width, height, dataPoint.InternalYValue >= 0, xPosition, yPosition,
                        ref line2dLabelCanvas, true);
                    break;

                case VcProperties.LabelFontColor:
                    //if (marker != null)
                    //    marker.FontColor = dataPoint.LabelFontColor;
                    CreateLabel4LineDataPoint(dataPoint, width, height, dataPoint.InternalYValue >= 0, xPosition, yPosition,
                        ref line2dLabelCanvas, true);
                    break;

                case VcProperties.LabelFontFamily:
                    //CreateMarkerAForLineDataPoint(dataPoint, width, height, ref line2dLabelCanvas, out xPosition, out yPosition);
                    CreateLabel4LineDataPoint(dataPoint, width, height, dataPoint.InternalYValue >= 0, xPosition, yPosition,
                        ref line2dLabelCanvas, true);
                    // marker.FontFamily = dataPoint.LabelFontFamily;
                    break;

                case VcProperties.LabelFontStyle:
                    //CreateMarkerAForLineDataPoint(dataPoint, width, height, ref line2dLabelCanvas, out xPosition, out yPosition);
                    CreateLabel4LineDataPoint(dataPoint, width, height, dataPoint.InternalYValue >= 0, xPosition, yPosition,
                        ref line2dLabelCanvas, true);
                    //marker.FontStyle = (FontStyle) dataPoint.LabelFontStyle;
                    break;

                case VcProperties.LabelFontSize:
                    //CreateMarkerAForLineDataPoint(dataPoint, width, height, ref line2dLabelCanvas, out xPosition, out yPosition);
                    CreateLabel4LineDataPoint(dataPoint, width, height, dataPoint.InternalYValue >= 0, xPosition, yPosition,
                        ref line2dLabelCanvas, true);
                    // marker.FontSize = (Double) dataPoint.LabelFontSize;
                    break;

                case VcProperties.LabelFontWeight:
                    //if (marker != null)
                    //    marker.FontWeight = (FontWeight) dataPoint.LabelFontWeight;
                    CreateLabel4LineDataPoint(dataPoint, width, height, dataPoint.InternalYValue >= 0, xPosition, yPosition,
                        ref line2dLabelCanvas, true);
                    break;

                case VcProperties.LabelStyle:
                    //CreateMarkerAForLineDataPoint(dataPoint, width, height, ref line2dLabelCanvas, out xPosition, out yPosition);
//.........这里部分代码省略.........
开发者ID:zhangzy0193,项目名称:visifire,代码行数:101,代码来源:StepLineChart.cs

示例3: UpdateMarkerAndLegend

        /// <summary>
        /// Update marker and legend for dataPoint
        /// </summary>
        /// <param name="Value">Color value</param>
        internal static void UpdateMarkerAndLegend(DataPoint dataPoint, object colorValue)
        {   
            Marker marker = dataPoint.Marker;

            if (marker != null && marker.Visual != null && (Boolean)dataPoint.MarkerEnabled)
            {   
                if (dataPoint.Parent.RenderAs == RenderAs.Point)
                {
                    marker.MarkerFillColor = dataPoint.Color; // (Brush)colorValue;

                    if (marker.MarkerType != MarkerTypes.Cross)
                    {
                        if (dataPoint.BorderColor != null)
                            marker.BorderColor = dataPoint.BorderColor;
                    }
                    else
                        marker.BorderColor = dataPoint.Color; // (Brush)colorValue;(Brush)colorValue;

                    // Marker.UpdateMarker();
                }
                else
                    marker.BorderColor = (dataPoint.GetValue(DataPoint.MarkerBorderColorProperty) as Brush == null) ? ((colorValue != null) ? colorValue as Brush : dataPoint.MarkerBorderColor) : dataPoint.MarkerBorderColor; // (Brush)colorValue;

                if (!dataPoint.Selected)
                    marker.UpdateMarker();
            }

            UpdateLegendMarker(dataPoint, colorValue as Brush);
        }
开发者ID:tdhieu,项目名称:openvss,代码行数:33,代码来源:DataPoint.cs

示例4: ApplyOrUpdateColorForACandleStick

        /// <summary>
        /// Apply or update Color for a CandleStick
        /// </summary>
        /// <param name="dataPoint">DataPoint</param>
        internal static void ApplyOrUpdateColorForACandleStick(DataPoint dataPoint)
        {   
            Faces dpFaces = dataPoint.Faces;
            Brush dataPointColor = (Brush)dataPoint.GetValue(DataPoint.ColorProperty);

            #region  Update Color for High-Low line and Open-Close rectangle

            Line highLowLine = dataPoint.Faces.VisualComponents[0] as Line;
            Rectangle openCloseRect = dataPoint.Faces.VisualComponents[1] as Rectangle;
            Brush highLowLineColor;
            Brush openCloseRectColor;
            openCloseRectColor = GetOpenCloseRectangleFillbrush(dataPoint, dataPointColor);

            if (dataPointColor == null)
                highLowLineColor = dataPoint.Parent.PriceUpColor;
            else
                highLowLineColor = dataPointColor;

            if ((Boolean)dataPoint.LightingEnabled)
            {
                openCloseRect.Fill = Graphics.GetLightingEnabledBrush(openCloseRectColor, "Linear", null);
                highLowLine.Stroke = Graphics.GetLightingEnabledBrush(highLowLineColor, "Linear", null);
            }
            else
            {
                openCloseRect.Fill = openCloseRectColor;
                highLowLine.Stroke = highLowLineColor;
            }
          
            #endregion

            #region Update Color for Bevel layer

            UpdateBevelLayerColor(dataPoint, openCloseRectColor);
            
            #endregion
        }
开发者ID:tdhieu,项目名称:openvss,代码行数:41,代码来源:CandleStickChart.cs

示例5: ApplyOrUpdateBorder

        /// <summary>
        /// Apply or Update border for the DataPoint
        /// </summary>
        /// <param name="dataPoint"></param>
        /// <param name="dataPointWidth"></param>
        private static void ApplyOrUpdateBorder(DataPoint dataPoint, Double dataPointWidth)
        {   
            Faces dpFaces = dataPoint.Faces;
            Line highLowLine = dataPoint.Faces.VisualComponents[0] as Line;
            Rectangle openCloseRect = dpFaces.VisualComponents[1] as Rectangle;

            highLowLine.StrokeThickness = GetStrokeThickness(dataPoint, dataPointWidth);
            highLowLine.StrokeDashArray = Graphics.LineStyleToStrokeDashArray(dataPoint.BorderStyle.ToString());

            openCloseRect.StrokeThickness = dataPoint.BorderThickness.Left;
            openCloseRect.StrokeDashArray = Graphics.LineStyleToStrokeDashArray(dataPoint.BorderStyle.ToString());
            openCloseRect.Stroke = GetOpenCloseRectangleBorderbrush(dataPoint, (Brush)dataPoint.GetValue(DataPoint.ColorProperty));
        }
开发者ID:tdhieu,项目名称:openvss,代码行数:18,代码来源:CandleStickChart.cs

示例6: ApplyOrRemoveBevel

        internal static void ApplyOrRemoveBevel(DataPoint dataPoint, Double dataPointWidth)
        {   
            // Removing parts of bevel
            Canvas bevelCanvas = null;
            Faces faces = dataPoint.Faces;
            Rectangle openCloseRect = faces.VisualComponents[1] as Rectangle;

            faces.ClearList(ref faces.BevelElements);

            // Create Bevel
            if (dataPoint.Parent.Bevel && dataPointWidth > 8 && openCloseRect.Height > 6)
            {
                Double reduceSize = openCloseRect.StrokeThickness;

                if (dataPoint.Parent.SelectionEnabled && dataPoint.BorderThickness.Left == 0)
                    reduceSize = 1.5 + reduceSize;

                if (openCloseRect.Width - 2 * reduceSize >= 0 && openCloseRect.Height - 2 * reduceSize >= 0)
                {
                    Brush color = GetOpenCloseRectangleFillbrush(dataPoint, (Brush) dataPoint.GetValue(DataPoint.ColorProperty));
                    bevelCanvas = ExtendedGraphics.Get2DRectangleBevel(dataPoint, openCloseRect.Width - 2 * reduceSize, openCloseRect.Height - 2 * reduceSize, 5, 5,
                       Graphics.GetBevelTopBrush(color),
                       Graphics.GetBevelSideBrush(((Boolean)dataPoint.LightingEnabled ? -70 : 0), color),
                       Graphics.GetBevelSideBrush(((Boolean)dataPoint.LightingEnabled ? -110 : 180), color),
                       Graphics.GetBevelSideBrush(90, color));

                    bevelCanvas.IsHitTestVisible = false;

                    bevelCanvas.SetValue(Canvas.TopProperty, (Double)openCloseRect.GetValue(Canvas.TopProperty) + reduceSize);
                    bevelCanvas.SetValue(Canvas.LeftProperty, reduceSize);

                    // Adding parts of bevel
                    foreach (FrameworkElement fe in bevelCanvas.Children)
                        dataPoint.Faces.BevelElements.Add(fe);

                    dataPoint.Faces.BevelElements.Add(bevelCanvas);

                    (dataPoint.Faces.Visual as Canvas).Children.Add(bevelCanvas);
                }
            }
        }
开发者ID:tdhieu,项目名称:openvss,代码行数:41,代码来源:CandleStickChart.cs

示例7: UpdateDataPoint

        /// <summary>
        /// 
        /// </summary>
        /// <param name="dataPoint"></param>
        /// <param name="property"></param>
        /// <param name="newValue"></param>
        /// <param name="isAxisChanged"></param>
        private static void UpdateDataPoint(DataPoint dataPoint, VcProperties property, object newValue, Boolean isAxisChanged)
        {
            Chart chart = dataPoint.Chart as Chart;
            PlotDetails plotDetails = chart.PlotDetails;

            Marker marker = dataPoint.Marker;
            DataSeries dataSeries = dataPoint.Parent;
            PlotGroup plotGroup = dataSeries.PlotGroup;
            Canvas areaVisual = dataSeries.Faces.Visual as Canvas;
            Canvas labelCanvas = ((areaVisual as FrameworkElement).Parent as Panel).Children[0] as Canvas;
            Double height = chart.ChartArea.ChartVisualCanvas.Height;
            Double width = chart.ChartArea.ChartVisualCanvas.Width;
            Double xPosition, yPosition;
            Faces faces = dataPoint.Faces;

            switch (property)
            {    
                 case VcProperties.Bevel:
                     UpdateDataSeries(dataSeries, property, newValue);
                     break;

                case VcProperties.Color:
                case VcProperties.LightingEnabled:
                     if (property != VcProperties.LightingEnabled && marker != null && (Boolean)dataPoint.MarkerEnabled)
                         marker.BorderColor = (dataPoint.GetValue(DataPoint.MarkerBorderColorProperty) as Brush == null) ? ((newValue != null) ? newValue as Brush : dataPoint.MarkerBorderColor) : dataPoint.MarkerBorderColor;

                    if (faces != null)
                    {
                        if(dataPoint.Faces.BevelLine != null)
                            dataPoint.Faces.BevelLine.Stroke = Graphics.GetBevelTopBrush(dataPoint.Parent.Color);

                        Brush sideBrush = (Boolean)dataSeries.LightingEnabled ? Graphics.GetRightFaceBrush(dataSeries.Color) : dataSeries.Color;
                        Brush topBrush = (Boolean)dataSeries.LightingEnabled ? Graphics.GetTopFaceBrush(dataSeries.Color) : dataSeries.Color;

                        if (dataPoint.Faces.Area3DLeftFace != null)
                            (dataPoint.Faces.Area3DLeftFace.LeftFace as Path).Fill = sideBrush;

                        if (dataPoint.Faces.Area3DRightTopFace != null)
                            (dataPoint.Faces.Area3DRightTopFace.TopFace as Path).Fill = topBrush;

                        if (dataPoint.Faces.Area3DLeftTopFace != null)
                            (dataPoint.Faces.Area3DLeftTopFace.TopFace as Path).Fill = topBrush;

                        if (dataPoint.Faces.Area3DRightFace != null)
                            (dataPoint.Faces.Area3DRightFace.RightFace as Path).Fill = sideBrush;
                    }

                    break;

                case VcProperties.Opacity:

                    Double opacity = dataPoint.Opacity * dataSeries.Opacity;
                    if (marker != null)
                        marker.Visual.Opacity = opacity;

                    if (faces != null)
                    {   
                        if (dataPoint.Faces.BevelLine != null)
                            dataPoint.Faces.BevelLine.Opacity = opacity;

                        if (dataPoint.Faces.Area3DLeftFace != null)
                            (dataPoint.Faces.Area3DLeftFace.LeftFace as Path).Opacity = opacity;

                        if (dataPoint.Faces.Area3DRightTopFace != null)
                            (dataPoint.Faces.Area3DRightTopFace.TopFace as Path).Opacity = opacity;

                        if (dataPoint.Faces.Area3DLeftTopFace != null)
                            (dataPoint.Faces.Area3DLeftTopFace.TopFace as Path).Opacity = opacity;

                        if (dataPoint.Faces.Area3DRightFace != null)
                            (dataPoint.Faces.Area3DRightFace.RightFace as Path).Opacity = opacity;
                    }

                    break;
                case VcProperties.BorderColor:
                case VcProperties.BorderStyle:
                case VcProperties.BorderThickness:
                    if (faces != null)
                    {
                        if (dataPoint.Faces.Area3DLeftFace != null)
                            ApplyBorderProperties(dataPoint.Faces.Area3DLeftFace.LeftFace as Path, dataSeries);

                        if (dataPoint.Faces.Area3DRightTopFace != null)
                            ApplyBorderProperties(dataPoint.Faces.Area3DRightTopFace.TopFace as Path, dataSeries);

                        if (dataPoint.Faces.Area3DLeftTopFace != null)
                            ApplyBorderProperties(dataPoint.Faces.Area3DLeftTopFace.TopFace as Path, dataSeries);

                        if (dataPoint.Faces.Area3DRightFace != null)
                            ApplyBorderProperties(dataPoint.Faces.Area3DRightFace.RightFace as Path, dataSeries);
                    }

                    break;
//.........这里部分代码省略.........
开发者ID:tdhieu,项目名称:openvss,代码行数:101,代码来源:AreaChart.cs


注:本文中的Visifire.Charts.DataPoint.GetValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。