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


C# DataPoint.SetHref2DataPointVisualFaces方法代码示例

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


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

示例1: 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

示例2: UpdateDataPoint

        //internal static void Update(Chart chart, RenderAs currentRenderAs, List<DataSeries> selectedDataSeries4Rendering, VcProperties property, object newValue)
        //{
        //    Boolean is3D = chart.View3D;
        //    ChartArea chartArea = chart.ChartArea;
        //    Canvas ChartVisualCanvas = chart.ChartArea.ChartVisualCanvas;

        //    // Double width = chart.ChartArea.ChartVisualCanvas.Width;
        //    // Double height = chart.ChartArea.ChartVisualCanvas.Height;

        //    Panel preExistingPanel = null;
        //    Dictionary<RenderAs, Panel> RenderedCanvasList = chart.ChartArea.RenderedCanvasList;

        //    if (chartArea.RenderedCanvasList.ContainsKey(currentRenderAs))
        //    {
        //        preExistingPanel = RenderedCanvasList[currentRenderAs];
        //    }

        //    Panel renderedChart = chartArea.RenderSeriesFromList(preExistingPanel, selectedDataSeries4Rendering);

        //    if (preExistingPanel == null)
        //    {
        //        chartArea.RenderedCanvasList.Add(currentRenderAs, renderedChart);
        //        ChartVisualCanvas.Children.Add(renderedChart);
        //    }
        //}

        /// <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;

            if (chart == null)
                return;

            PlotDetails plotDetails = chart.PlotDetails;
            Marker marker = dataPoint.Marker;
            DataSeries dataSeries = dataPoint.Parent;

            if (dataSeries.Faces == null)
                return;

            Canvas pointChartCanvas = dataSeries.Faces.Visual as Canvas;

            Double plotHeight = chart.ChartArea.ChartVisualCanvas.Height;
            Double plotWidth = chart.ChartArea.ChartVisualCanvas.Width;
            ColumnChart.UpdateParentVisualCanvasSize(chart, pointChartCanvas);

            if (property == VcProperties.Enabled || ((dataPoint.Faces == null || Double.IsNaN(dataPoint.InternalYValue)) && (property == VcProperties.XValue || property == VcProperties.YValue)))
            {
                CreateOrUpdateAPointDataPoint(pointChartCanvas, dataPoint, plotWidth, plotHeight);
                return;
            }

            if (dataPoint.Faces == null)
                return;

            //Grid bubbleVisual = dataPoint.Faces.Visual as Grid;
            
            switch (property)
            {
                case VcProperties.Bevel:
                    break;

                case VcProperties.Cursor:
                    break;

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

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

                case VcProperties.LabelBackground:
                    if (marker != null)
                        marker.TextBackground = dataPoint.LabelBackground;
                    break;

                case VcProperties.LabelEnabled:
                    CreateOrUpdateAPointDataPoint(pointChartCanvas, dataPoint, plotWidth, plotHeight);
                    //if (marker != null)
                    //    marker.LabelEnabled = (Boolean)dataPoint.LabelEnabled;
                    break;

                case VcProperties.LabelFontColor:
                    if (marker != null)
                        marker.FontColor = dataPoint.LabelFontColor;

                    break;

                case VcProperties.LabelFontFamily:
                    if (marker != null)
                        marker.FontFamily = dataPoint.LabelFontFamily;
//.........这里部分代码省略.........
开发者ID:zhangzy0193,项目名称:visifire,代码行数:101,代码来源:PointChart.cs

示例3: UpdateDataPoint

        private static void UpdateDataPoint(DataPoint dataPoint, VcProperties property, object newValue, Boolean isAxisChanged)
        {
            Chart chart = dataPoint.Chart as Chart;
            DataSeries dataSeries = dataPoint.Parent;
            PlotGroup plotGroup = dataSeries.PlotGroup;
            Faces dsFaces = dataSeries.Faces;
            Faces dpFaces = dataPoint.Faces;
            Double dataPointWidth;

            if (dsFaces != null)
                ColumnChart.UpdateParentVisualCanvasSize(chart, dsFaces.Visual as Canvas);

            if (dpFaces != null && dpFaces.Visual != null)
                dataPointWidth = dpFaces.Visual.Width;
            else if (dsFaces == null)
                return;
            else
                dataPointWidth = CalculateDataPointWidth(dsFaces.Visual.Width, dsFaces.Visual.Height, chart);
            
            switch (property)
            {   
                case VcProperties.BorderThickness:
                      ApplyOrUpdateBorder(dataPoint, dataPointWidth);
                      ApplyOrRemoveBevel(dataPoint, dataPointWidth);
                    break;

                case VcProperties.BorderStyle:
                    ApplyOrUpdateBorder(dataPoint, dataPointWidth);
                    break;

                case VcProperties.BorderColor:
                    ApplyOrUpdateBorder(dataPoint, dataPointWidth);
                    break;

                case VcProperties.Bevel:
                    ApplyOrRemoveBevel(dataPoint, dataPointWidth);
                    break;

                case VcProperties.Color:
                case VcProperties.PriceUpColor:
                case VcProperties.PriceDownColor:
                    ApplyOrUpdateColorForACandleStick(dataPoint);
                    break;
                    
                case VcProperties.Cursor:
                    dataPoint.SetCursor2DataPointVisualFaces();
                    break;

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

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

                case VcProperties.LabelBackground:
                case VcProperties.LabelEnabled:
                case VcProperties.LabelFontColor:
                case VcProperties.LabelFontFamily:
                case VcProperties.LabelFontStyle:
                case VcProperties.LabelFontSize:
                case VcProperties.LabelFontWeight:
                case VcProperties.LabelStyle:
                case VcProperties.LabelText:
                    CreateAndPositionLabel(dsFaces.LabelCanvas, dataPoint);
                    break;


                case VcProperties.LegendText:
                    chart.InvokeRender();
                    break;

                case VcProperties.LightingEnabled:
                    ApplyOrUpdateColorForACandleStick(dataPoint);
                    break;

                //case VcProperties.MarkerBorderColor:
                //case VcProperties.MarkerBorderThickness:
                //case VcProperties.MarkerColor:
                //case VcProperties.MarkerEnabled:
                //case VcProperties.MarkerScale:
                //case VcProperties.MarkerSize:
                //case VcProperties.MarkerType:
                case VcProperties.ShadowEnabled:
                    ApplyOrRemoveShadow(dataPoint, dataPointWidth);
                    break;

                case VcProperties.Opacity:
                    dpFaces.Visual.Opacity = dataSeries.Opacity * dataPoint.Opacity;
                    break;

                case VcProperties.ShowInLegend:
                    chart.InvokeRender();
                    break;
                case VcProperties.ToolTipText:
                    dataPoint._parsedToolTipText = dataPoint.TextParser(dataPoint.ToolTipText);
                    break;

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

示例4: 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;

            if (chart == null)
                return;

            PlotDetails plotDetails = chart.PlotDetails;
            Marker marker = dataPoint.Marker;
            DataSeries dataSeries = dataPoint.Parent;

            if (dataSeries.Faces == null)
                return;

            Canvas bubleChartCanvas = dataSeries.Faces.Visual as Canvas;
            
            Double plotHeight = chart.ChartArea.ChartVisualCanvas.Height;
            Double plotWidth = chart.ChartArea.ChartVisualCanvas.Width;
            Double minimumZVal, maximumZVal;

            ColumnChart.UpdateParentVisualCanvasSize(chart, bubleChartCanvas);

            if (property == VcProperties.Enabled || ((dataPoint.Faces == null || Double.IsNaN(dataPoint.InternalYValue)) && (property == VcProperties.XValue || property == VcProperties.YValue)))
            {   
                dataPoint._parsedToolTipText = dataPoint.TextParser(dataPoint.ToolTipText);

                // Calculate max and min ZValue from all DataSeries
                List<DataSeries> seriesList = (from ds in chart.InternalSeries where ds.RenderAs == RenderAs.Bubble && ((Boolean)ds.Enabled == true) select ds).ToList(); 
                CalculateMaxAndMinZValueFromAllSeries(ref seriesList, out minimumZVal, out maximumZVal);

                CreateOrUpdateAPointDataPoint(bubleChartCanvas, dataPoint, minimumZVal, maximumZVal, plotWidth, plotHeight);
                return;
            }

            if (dataPoint.Faces == null)
                return;

            Grid bubbleVisual = dataPoint.Faces.Visual as Grid;
            
            switch (property)
            {   
                case VcProperties.Bevel:
                    break;
                
                case VcProperties.Cursor:
                    break;

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

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

                case VcProperties.LabelBackground:
                    if (marker != null)
                        marker.TextBackground = dataPoint.LabelBackground;
                    break;

                case VcProperties.LabelEnabled:
                    CalculateMaxAndMinZValue(dataPoint.Parent, out minimumZVal, out maximumZVal);
                    CreateOrUpdateAPointDataPoint(bubleChartCanvas, dataPoint, minimumZVal, maximumZVal, plotWidth, plotHeight);

                    // if (marker != null)
                    //   marker.LabelEnabled = (Boolean)dataPoint.LabelEnabled;

                    break;

                case VcProperties.LabelFontColor:
                    if (marker != null)
                        marker.FontColor = dataPoint.LabelFontColor;

                    break;

                case VcProperties.LabelFontFamily:
                    if (marker != null)
                        marker.FontFamily = dataPoint.LabelFontFamily;
                    break;

                case VcProperties.LabelFontStyle:
                    if (marker != null)
                        marker.FontStyle = (FontStyle)dataPoint.LabelFontStyle;
                    break;

                //case VcProperties.LabelFontSize:
                //    if (marker != null)
                //        marker.FontSize = (Double)dataPoint.LabelFontSize;
                //    break;

                case VcProperties.LabelFontWeight:
                    if (marker != null)
                        marker.FontWeight = (FontWeight)dataPoint.LabelFontWeight;
//.........这里部分代码省略.........
开发者ID:zhangzy0193,项目名称:visifire,代码行数:101,代码来源:BubbleChart.cs

示例5: UpdateDataPoint


//.........这里部分代码省略.........
                        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;
                case VcProperties.Cursor:
                    dataPoint.SetCursor2DataPointVisualFaces();
                    break;

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

                case VcProperties.LabelBackground:
                    LineChart.CreateMarkerAForLineDataPoint(dataPoint, width, height, ref labelCanvas, out xPosition, out yPosition);
                    marker.TextBackground = dataPoint.LabelBackground;
                    break;

                case VcProperties.LabelEnabled:
                    LineChart.CreateMarkerAForLineDataPoint(dataPoint, width, height, ref labelCanvas, out xPosition, out yPosition);
                    break;

                case VcProperties.LabelFontColor:
                    marker.FontColor = dataPoint.LabelFontColor;
                    break;

                case VcProperties.LabelFontFamily:
                    LineChart.CreateMarkerAForLineDataPoint(dataPoint, width, height, ref labelCanvas, out xPosition, out yPosition);
                    // marker.FontFamily = dataPoint.LabelFontFamily;
                    break;

                case VcProperties.LabelFontStyle:
                    LineChart.CreateMarkerAForLineDataPoint(dataPoint, width, height, ref labelCanvas, out xPosition, out yPosition);

                    //marker.FontStyle = (FontStyle) dataPoint.LabelFontStyle;
                    break;

                case VcProperties.LabelFontSize:
                    LineChart.CreateMarkerAForLineDataPoint(dataPoint, width, height, ref labelCanvas, out xPosition, out yPosition);

                    // marker.FontSize = (Double) dataPoint.LabelFontSize;
                    break;
开发者ID:tdhieu,项目名称:openvss,代码行数:66,代码来源:AreaChart.cs

示例6: UpdateDataPoint

        private static void UpdateDataPoint(DataPoint dataPoint, VcProperties property, object newValue, Boolean isAxisChanged)
        {
            Chart chart = dataPoint.Chart as Chart;

            if (chart == null)
                return;

            DataSeries dataSeries = dataPoint.Parent;
            PlotGroup plotGroup = dataSeries.PlotGroup;
            Faces dsFaces = dataSeries.Faces;
            Faces dpFaces = dataPoint.Faces;
            
            Double dataPointWidth;

            if (dsFaces != null)
                ColumnChart.UpdateParentVisualCanvasSize(chart, dsFaces.Visual as Canvas);

            if (dpFaces != null && dpFaces.Visual != null)
                dataPointWidth = dpFaces.Visual.Width;
            else if (dsFaces == null)
                return;
            else
                dataPointWidth = CandleStick.CalculateDataPointWidth(dsFaces.Visual.Width, dsFaces.Visual.Height, chart);

            if (property == VcProperties.Enabled || (dpFaces == null && (property == VcProperties.XValue || property == VcProperties.YValues)))
            {
                CreateOrUpdateAStockDataPoint(dataPoint, dsFaces.Visual as Canvas, dsFaces.LabelCanvas, dsFaces.Visual.Width, dsFaces.Visual.Height, dataPointWidth);
                return;
            }

            if (dpFaces == null)
                return;

            Canvas dataPointVisual = dpFaces.Visual as Canvas;       // DataPoint visual canvas
            Line highLowLine = dpFaces.VisualComponents[0] as Line;  // HighLowline
            Line closeLine = dpFaces.VisualComponents[1] as Line;    // Closeline
            Line openLine = dpFaces.VisualComponents[2] as Line;     // Openline

            switch (property)
            {   
                case VcProperties.BorderThickness:
                case VcProperties.BorderStyle:
                    ApplyBorderProperties(dataPoint, highLowLine, openLine, closeLine, dataPointWidth);
                    break;

                case VcProperties.Color:
                    ApplyOrUpdateColorForAStockDp(dataPoint, highLowLine, openLine, closeLine);
                    break;

                case VcProperties.Cursor:
                    dataPoint.SetCursor2DataPointVisualFaces();
                    break;

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

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

                case VcProperties.LabelBackground:
                case VcProperties.LabelEnabled:
                case VcProperties.LabelFontColor:
                case VcProperties.LabelFontFamily:
                case VcProperties.LabelFontStyle:
                case VcProperties.LabelFontSize:
                case VcProperties.LabelFontWeight:
                case VcProperties.LabelStyle:
                case VcProperties.LabelText:
                    CandleStick.CreateAndPositionLabel(dsFaces.LabelCanvas, dataPoint);
                    break;

                case VcProperties.LegendText:
                    chart.InvokeRender();
                    break;

                case VcProperties.LightingEnabled:
                    ApplyOrUpdateColorForAStockDp(dataPoint, highLowLine, openLine, closeLine);
                    break;

                //case VcProperties.MarkerBorderColor:
                //case VcProperties.MarkerBorderThickness:
                //case VcProperties.MarkerColor:
                //case VcProperties.MarkerEnabled:
                //case VcProperties.MarkerScale:
                //case VcProperties.MarkerSize:
                //case VcProperties.MarkerType:
                case VcProperties.ShadowEnabled:
                    ApplyOrUpdateShadow(dataPoint, dataPointVisual, highLowLine, openLine, closeLine, dataPointWidth);
                    break;

                case VcProperties.Opacity:
                    dpFaces.Visual.Opacity = (Double)dataSeries.Opacity * (Double)dataPoint.Opacity;
                    break;

                case VcProperties.ShowInLegend:
                    chart.InvokeRender();
                    break;

//.........这里部分代码省略.........
开发者ID:zhangzy0193,项目名称:visifire,代码行数:101,代码来源:StockChart.cs


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