本文整理汇总了C#中Visifire.Charts.DataPoint.Select方法的典型用法代码示例。如果您正苦于以下问题:C# DataPoint.Select方法的具体用法?C# DataPoint.Select怎么用?C# DataPoint.Select使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Visifire.Charts.DataPoint
的用法示例。
在下文中一共展示了DataPoint.Select方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: UpdateVisualForYValue4StackedColumnChart
//.........这里部分代码省略.........
FrameworkElement newVisual = dp.Faces.Visual; // New StackedColumn visual reference of DataPoint
Double oldTop = (Double)dp._oldVisual.GetValue(Canvas.TopProperty); // Top of the old visual of the DataPoint
Double newTop = (Double)newVisual.GetValue(Canvas.TopProperty); // Top of the new visual of the DataPoint
Double oldHeight = dp._oldVisual.Height; // Height of the old visual of the DataPoint
Double newHeight = newVisual.Height; // Height of the new visual of the DataPoint
Double oldScale = oldHeight / newHeight; // Scale value for the old DataPoint
System.Diagnostics.Debug.WriteLine("DataPoint--oldTop =" + oldTop.ToString() + " newTop=" + newTop.ToString() + "oldYValue=" + dp._oldYValue.ToString() + " newYValue=" + dp.InternalYValue.ToString());
if (dp == dataPoint)
{
isPositive = (dataPoint._oldYValue < 0 && dataPoint.InternalYValue > 0) ? true :
(dataPoint._oldYValue > 0 && dataPoint.InternalYValue < 0) ? false :
dp._oldYValue >= 0 ? true : false;
}
else
isPositive = dp.InternalYValue >= 0 ? true : false;
if (isPositive)
newVisual.RenderTransformOrigin = new Point(0.5, 1);
else
newVisual.RenderTransformOrigin = new Point(0.5, 0);
// Apply new RenderTransform to the DataPoint Visual
newVisual.RenderTransform = new ScaleTransform();
if(Double.IsInfinity(oldScale) || Double.IsNaN(oldScale))
oldScale = 0;
// if (oldScale > 1)
// oldScale = 1.1;
if (oldScale != 1)
dataPoint.Storyboard = AnimationHelper.ApplyPropertyAnimation(newVisual, "(UIElement.RenderTransform).(ScaleTransform.ScaleY)", dataPoint, dataPoint.Storyboard, 0,
new Double[] { 0, 1 }, new Double[] { oldScale, 1 }, null);
if ((isAnimateTop && oldTop != newTop) || (dp._oldYValue == dp.InternalYValue && oldTop != newTop))
{
System.Diagnostics.Debug.WriteLine("Animate Top ----");
newVisual.SetValue(Canvas.TopProperty, oldTop);
dataPoint.Storyboard = AnimationHelper.ApplyPropertyAnimation(newVisual, "(Canvas.Top)", dataPoint, dataPoint.Storyboard, 0,
new Double[] { 0, 1 }, new Double[] { oldTop, newTop }, null);
}
if (dp == dataPoint)
isAnimateTop = true;
// Apply animation to markers if marker exists
if (dp.Marker != null && dp.Marker.Visual != null)
{
Double markerNewTop = (Double)dp.Marker.Visual.GetValue(Canvas.TopProperty);
dataPoint.Storyboard = AnimationHelper.ApplyPropertyAnimation(dp.Marker.Visual, "(Canvas.Top)", dataPoint, dataPoint.Storyboard, 0,
new Double[] { 0, 1 }, new Double[] { dp._oldMarkerPosition.Y, markerNewTop }, null);
dp.Marker.Visual.SetValue(Canvas.TopProperty, dp._oldMarkerPosition.Y);
}
if (dp.LabelVisual != null)
{
Double labelNewTop = (Double)dp.LabelVisual.GetValue(Canvas.TopProperty);
dataPoint.Storyboard = AnimationHelper.ApplyPropertyAnimation(dp.LabelVisual, "(Canvas.Top)", dataPoint, dataPoint.Storyboard, 0,
new Double[] { 0, 1 }, new Double[] { dp._oldLabelPosition.Y, labelNewTop }, null);
dp.LabelVisual.SetValue(Canvas.TopProperty, dp._oldLabelPosition.Y);
}
dataPoint.Storyboard.SpeedRatio = 2;
// Remove old visual of the DataPoint from the columncanvas
dp._oldVisual = null;
}
dataPoint.Storyboard.SpeedRatio = 2;
// Begin storyboard animation
#if WPF
dataPoint.Storyboard.Begin(dataPoint.Chart._rootElement, true);
#else
dataPoint.Storyboard.Begin();
#endif
}
if (columnCanvas.Parent != null)
{
width = chart.ChartArea.ChartVisualCanvas.Width;
height = chart.ChartArea.ChartVisualCanvas.Height;
RectangleGeometry clipRectangle = new RectangleGeometry();
clipRectangle.Rect = new Rect(0, -chart.ChartArea.PLANK_DEPTH - (chart.View3D ? 0 : 5), width + chart.ChartArea.PLANK_DEPTH, height + chart.ChartArea.PLANK_DEPTH + chart.ChartArea.PLANK_THICKNESS + (chart.View3D ? 0 : 10));
(columnCanvas.Parent as Canvas).Clip = clipRectangle;
}
if (dataPoint.Parent.SelectionEnabled && dataPoint.Selected)
dataPoint.Select(true);
}
示例2: CreateOrUpdateAPointDataPoint
//.........这里部分代码省略.........
Marker marker = new Marker((MarkerTypes)dataPoint.MarkerType, (Double)dataPoint.MarkerScale, markerSize, markerBevel, markerColor, labelText);
marker.Tag = new ElementData() { Element = dataPoint };
marker.ShadowEnabled = (Boolean)dataPoint.ShadowEnabled;
if (!VisifireControl.IsMediaEffectsEnabled)
marker.PixelLavelShadow = false;
else
marker.PixelLavelShadow = true;
marker.MarkerSize = new Size((Double)dataPoint.MarkerSize, (Double)dataPoint.MarkerSize);
if (marker.MarkerType != MarkerTypes.Cross)
{
if (dataPoint.BorderColor != null)
marker.BorderColor = dataPoint.BorderColor;
}
else
marker.BorderColor = markerColor;
marker.BorderThickness = ((Thickness)dataPoint.MarkerBorderThickness).Left;
if (!String.IsNullOrEmpty(labelText))
{
marker.FontColor = Chart.CalculateDataPointLabelFontColor(chart, dataPoint, dataPoint.LabelFontColor, LabelStyles.OutSide);
marker.FontSize = (Double)dataPoint.LabelFontSize;
marker.FontWeight = (FontWeight)dataPoint.LabelFontWeight;
marker.FontFamily = dataPoint.LabelFontFamily;
marker.FontStyle = (FontStyle)dataPoint.LabelFontStyle;
marker.TextBackground = dataPoint.LabelBackground;
marker.TextAlignmentX = AlignmentX.Center;
marker.TextAlignmentY = AlignmentY.Center;
if (!Double.IsNaN(dataPoint.LabelAngle) && dataPoint.LabelAngle != 0)
{
marker.LabelAngle = dataPoint.LabelAngle;
marker.TextOrientation = Orientation.Vertical;
marker.TextAlignmentX = AlignmentX.Center;
marker.TextAlignmentY = AlignmentY.Center;
marker.LabelStyle = (LabelStyles)dataPoint.LabelStyle;
}
marker.CreateVisual();
if (Double.IsNaN(dataPoint.LabelAngle) || dataPoint.LabelAngle == 0)
{
if ((yPosition - marker.TextBlockSize.Height / 2) < 0)
marker.TextAlignmentY = AlignmentY.Bottom;
else if ((yPosition + marker.TextBlockSize.Height / 2) > plotAreaHeight)
marker.TextAlignmentY = AlignmentY.Top;
if ((xPosition - marker.TextBlockSize.Width / 2) < 0)
marker.TextAlignmentX = AlignmentX.Right;
else if ((xPosition + marker.TextBlockSize.Width / 2) > plotAreaWidth)
marker.TextAlignmentX = AlignmentX.Left;
}
}
//marker.LabelEnabled =(Boolean) dataPoint.LabelEnabled;
//marker.TextBackground = dataPoint.LabelBackground;
//marker.FontColor = Chart.CalculateDataPointLabelFontColor(chart, dataPoint, dataPoint.LabelFontColor, LabelStyles.OutSide);
//marker.FontSize = (Double)dataPoint.LabelFontSize;
//marker.FontWeight = (FontWeight)dataPoint.LabelFontWeight;
//marker.FontFamily = dataPoint.LabelFontFamily;
//marker.FontStyle = (FontStyle)dataPoint.LabelFontStyle;
//marker.TextAlignmentX = AlignmentX.Center;
//marker.TextAlignmentY = AlignmentY.Center;
marker.CreateVisual();
marker.Visual.Opacity = (Double)dataPoint.Opacity * (Double)dataPoint.Parent.Opacity;
marker.AddToParent(pointChartCanvas, xPosition, yPosition, new Point(0.5, 0.5));
dataPoint._visualPosition = new Point(xPosition, yPosition);
dpFaces.VisualComponents.Add(marker.Visual);
dpFaces.Visual = marker.Visual;
dpFaces.BorderElements.Add(marker.MarkerShape);
dataPoint.Marker = marker;
dataPoint.Faces = dpFaces;
dataPoint.Faces.Visual.Opacity = (Double)dataPoint.Opacity * (Double)dataPoint.Parent.Opacity;
dataPoint.AttachEvent2DataPointVisualFaces(dataPoint);
dataPoint.AttachEvent2DataPointVisualFaces(dataPoint.Parent);
dataPoint._parsedToolTipText = dataPoint.TextParser(dataPoint.ToolTipText);
if(!chart.IndicatorEnabled)
dataPoint.AttachToolTip(chart, dataPoint, dataPoint.Faces.VisualComponents);
dataPoint.AttachHref(chart, dataPoint.Faces.VisualComponents, dataPoint.Href, (HrefTargets)dataPoint.HrefTarget);
dataPoint.SetCursor2DataPointVisualFaces();
if (dataPoint.Parent.SelectionEnabled && dataPoint.Selected)
dataPoint.Select(true);
}
示例3: ApplySelectionChanged
private static void ApplySelectionChanged(DataPoint dataPoint, Boolean selectedValue)
{
if (dataPoint.Parent == null)
return;
Boolean selected = selectedValue & dataPoint.Parent.SelectionEnabled;
if (selected)
{
dataPoint.Select(true);
if(dataPoint.Parent.SelectionMode == SelectionModes.Single || dataPoint.Parent.RenderAs == RenderAs.SectionFunnel || dataPoint.Parent.RenderAs == RenderAs.StreamLineFunnel)
dataPoint.DeSelectOthers();
}
else
dataPoint.DeSelect(dataPoint , true, true);
}
示例4: UpdateDataPoint
//.........这里部分代码省略.........
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:
case VcProperties.YValueFormatString:
dataPoint._parsedToolTipText = dataPoint.TextParser(dataPoint.ToolTipText);
CreateAndPositionLabel(dsFaces.LabelCanvas, dataPoint);
break;
case VcProperties.XValueType:
chart.InvokeRender();
break;
case VcProperties.Enabled:
CreateOrUpdateACandleStick(dataPoint, dsFaces.Visual as Canvas, dsFaces.LabelCanvas, dsFaces.Visual.Width, dsFaces.Visual.Height, dataPointWidth);
break;
case VcProperties.XValue:
case VcProperties.YValues:
if (isAxisChanged)
UpdateDataSeries(dataSeries, property, newValue, isAxisChanged);
else
{
dataPoint._parsedToolTipText = dataPoint.TextParser(dataPoint.ToolTipText);
UpdateYValueAndXValuePosition(dataPoint, dsFaces.Visual.Width, dsFaces.Visual.Height, dpFaces.Visual.Width);
if ((Boolean)dataPoint.LabelEnabled)
CreateAndPositionLabel(dsFaces.LabelCanvas, dataPoint);
}
if (dataPoint.Parent.SelectionEnabled && dataPoint.Selected)
dataPoint.Select(true);
break;
}
}
示例5: UpdateDataPoint
//.........这里部分代码省略.........
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;
case VcProperties.ToolTipText:
dataPoint._parsedToolTipText = dataPoint.TextParser(dataPoint.ToolTipText);
break;
case VcProperties.XValueFormatString:
case VcProperties.YValueFormatString:
dataPoint._parsedToolTipText = dataPoint.TextParser(dataPoint.ToolTipText);
CandleStick.CreateAndPositionLabel(dsFaces.LabelCanvas, dataPoint);
break;
case VcProperties.XValueType:
chart.InvokeRender();
break;
case VcProperties.Enabled:
CreateOrUpdateAStockDataPoint(dataPoint, dsFaces.Visual as Canvas, dsFaces.LabelCanvas, dsFaces.Visual.Width, dsFaces.Visual.Height, dataPointWidth);
break;
case VcProperties.XValue:
case VcProperties.YValue:
case VcProperties.YValues:
if (isAxisChanged || dataPoint.InternalYValues == null)
UpdateDataSeries(dataSeries, property, newValue, isAxisChanged);
else
{
dataPoint._parsedToolTipText = dataPoint.TextParser(dataPoint.ToolTipText);
UpdateYValueAndXValuePosition(dataPoint, dsFaces.Visual.Width, dsFaces.Visual.Height, dpFaces.Visual.Width);
if ((Boolean)dataPoint.LabelEnabled)
CandleStick.CreateAndPositionLabel(dsFaces.LabelCanvas, dataPoint);
}
if (dataPoint.Parent.SelectionEnabled && dataPoint.Selected)
dataPoint.Select(true);
break;
}
}
示例6: UpdateVisualForYValue4StackedBarChart
//.........这里部分代码省略.........
{
if (dp.Faces == null || dp._oldVisual == null)
continue;
FrameworkElement newVisual = dp.Faces.Visual; // New StackedColumn visual reference of DataPoint
Double oldLeft = (Double)dp._oldVisual.GetValue(Canvas.LeftProperty); // Left of the old visual of the DataPoint
Double newLeft = (Double)newVisual.GetValue(Canvas.LeftProperty); // Left of the new visual of the DataPoint
Double oldWidth = dp._oldVisual.Width; // Width of the old visual of the DataPoint
Double newWidth = newVisual.Width; // Width of the new visual of the DataPoint
Double oldScale = oldWidth / newWidth; // Scale value for the old DataPoint
if (dp == dataPoint)
{
isPositive = (dataPoint._oldYValue < 0 && dataPoint.InternalYValue > 0) ? true :
(dataPoint._oldYValue > 0 && dataPoint.InternalYValue < 0) ? false :
dp._oldYValue >= 0 ? true : false;
}
else
isPositive = dp.InternalYValue >= 0 ? true : false;
if (isPositive)
newVisual.RenderTransformOrigin = new Point(0, 0.5);
else
newVisual.RenderTransformOrigin = new Point(1, 0.5);
// Apply new RenderTransform to the DataPoint Visual
newVisual.RenderTransform = new ScaleTransform();
if (Double.IsInfinity(oldScale) || Double.IsNaN(oldScale))
oldScale = 0;
if (oldScale != 1)
dataPoint.Storyboard = AnimationHelper.ApplyPropertyAnimation(newVisual, "(UIElement.RenderTransform).(ScaleTransform.ScaleX)", dataPoint, dataPoint.Storyboard, 0,
new Double[] { 0, 1 }, new Double[] { oldScale, 1 }, null);
if ((isAnimateLeft && oldLeft != newLeft) || dp._oldYValue == dp.InternalYValue && oldLeft != newLeft)
{
newVisual.SetValue(Canvas.LeftProperty, oldLeft);
dataPoint.Storyboard = AnimationHelper.ApplyPropertyAnimation(newVisual, "(Canvas.Left)", dataPoint, dataPoint.Storyboard, 0,
new Double[] { 0, 1 }, new Double[] { oldLeft, newLeft }, null);
}
if (dp == dataPoint)
isAnimateLeft = true;
// Apply animation to markers if marker exists
if (dp.Marker != null && dp.Marker.Visual != null)
{
Double markerNewLeft = (Double)dp.Marker.Visual.GetValue(Canvas.LeftProperty);
dp.Marker.Visual.SetValue(Canvas.LeftProperty, dp._oldMarkerPosition.X);
dataPoint.Storyboard = AnimationHelper.ApplyPropertyAnimation(dp.Marker.Visual, "(Canvas.Left)", dataPoint, dataPoint.Storyboard, 0,
new Double[] { 0, 1 }, new Double[] { dp._oldMarkerPosition.X, markerNewLeft }, null);
}
if (dp.LabelVisual != null)
{
Double labelNewLeft = (Double)dp.LabelVisual.GetValue(Canvas.LeftProperty);
System.Diagnostics.Debug.WriteLine("oldPos=" + dp._oldLabelPosition.X.ToString() + " NewPos=" + labelNewLeft.ToString());
dp.LabelVisual.SetValue(Canvas.LeftProperty, dp._oldLabelPosition.X);
dataPoint.Storyboard = AnimationHelper.ApplyPropertyAnimation(dp.LabelVisual, "(Canvas.Left)", dataPoint, dataPoint.Storyboard, 0,
new Double[] { 0, 1 }, new Double[] { dp._oldLabelPosition.X, labelNewLeft }, null);
}
dataPoint.Storyboard.SpeedRatio = 2;
// Remove old visual of the DataPoint from the columncanvas
dp._oldVisual = null;
}
dataPoint.Storyboard.SpeedRatio = 2;
// Begin storyboard animation
#if WPF
dataPoint.Storyboard.Begin(dataPoint.Chart._rootElement, true);
#else
dataPoint.Storyboard.Begin();
#endif
}
if (columnCanvas.Parent != null)
{
Double width = chart.ChartArea.ChartVisualCanvas.Width;
Double height = chart.ChartArea.ChartVisualCanvas.Height;
RectangleGeometry clipRectangle = new RectangleGeometry();
clipRectangle.Rect = new Rect(-(chart.View3D ? 0 : 5) - chart.ChartArea.PLANK_THICKNESS, -chart.ChartArea.PLANK_DEPTH, width + chart.ChartArea.PLANK_DEPTH + chart.ChartArea.PLANK_THICKNESS + (chart.View3D ? 0 : 10)
, height + chart.ChartArea.PLANK_DEPTH);
(columnCanvas.Parent as Canvas).Clip = clipRectangle;
}
if (dataPoint.Parent.SelectionEnabled && dataPoint.Selected)
dataPoint.Select(true);
}
示例7: CreateOrUpdateAPointDataPoint
//.........这里部分代码省略.........
if (Double.IsNaN(dataPoint.InternalYValue) || (dataPoint.Enabled == false))
return;
Chart chart = dataPoint.Chart as Chart;
PlotGroup plotGroup = dataPoint.Parent.PlotGroup;
Canvas dataPointVisual = new Canvas();
Faces bubbleFaces = new Faces();
Double xPosition = Graphics.ValueToPixelPosition(0, plotWidth, (Double)plotGroup.AxisX.InternalAxisMinimum, (Double)plotGroup.AxisX.InternalAxisMaximum, dataPoint.InternalXValue);
Double yPosition = Graphics.ValueToPixelPosition(plotHeight, 0, (Double)plotGroup.AxisY.InternalAxisMinimum, (Double)plotGroup.AxisY.InternalAxisMaximum, dataPoint.InternalYValue);
Brush markerColor = dataPoint.Color;
markerColor = (chart.View3D ? Graphics.Get3DBrushLighting(markerColor, (Boolean)dataPoint.LightingEnabled) : ((Boolean)dataPoint.LightingEnabled ? Graphics.GetLightingEnabledBrush(markerColor, "Linear", null) : markerColor));
String labelText = (Boolean)dataPoint.LabelEnabled ? dataPoint.TextParser(dataPoint.LabelText) : "";
Marker marker = new Marker((MarkerTypes)dataPoint.MarkerType, 1, new Size(6,6), false, markerColor, labelText);
dataPoint.Marker = marker;
ApplyZValue(dataPoint, minimumZVal, maximumZVal, plotWidth, plotHeight);
marker.ShadowEnabled = (Boolean)dataPoint.ShadowEnabled;
if (dataPoint.BorderColor != null)
marker.BorderColor = dataPoint.BorderColor;
marker.TextBackground = dataPoint.LabelBackground;
marker.BorderThickness = ((Thickness)dataPoint.MarkerBorderThickness).Left;
marker.TextAlignmentX = AlignmentX.Center;
marker.TextAlignmentY = AlignmentY.Center;
marker.Tag = new ElementData() { Element = dataPoint };
Double gap = ((Double)dataPoint.MarkerScale * (Double)dataPoint.MarkerSize) / 2;
if (!String.IsNullOrEmpty(labelText))
{
marker.FontColor = Chart.CalculateDataPointLabelFontColor(chart, dataPoint, dataPoint.LabelFontColor, LabelStyles.OutSide);
marker.FontSize = (Double)dataPoint.LabelFontSize;
marker.FontWeight = (FontWeight)dataPoint.LabelFontWeight;
marker.FontFamily = dataPoint.LabelFontFamily;
marker.FontStyle = (FontStyle)dataPoint.LabelFontStyle;
marker.TextBackground = dataPoint.LabelBackground;
marker.TextAlignmentX = AlignmentX.Center;
marker.TextAlignmentY = AlignmentY.Center;
if (!Double.IsNaN(dataPoint.LabelAngle) && dataPoint.LabelAngle != 0)
{
marker.LabelAngle = dataPoint.LabelAngle;
marker.TextOrientation = Orientation.Vertical;
marker.TextAlignmentX = AlignmentX.Center;
marker.TextAlignmentY = AlignmentY.Center;
marker.LabelStyle = (LabelStyles)dataPoint.LabelStyle;
}
marker.CreateVisual();
if (Double.IsNaN(dataPoint.LabelAngle) || dataPoint.LabelAngle == 0)
{
if (yPosition - gap < 0 && (yPosition - marker.TextBlockSize.Height / 2) < 0)
marker.TextAlignmentY = AlignmentY.Bottom;
else if (yPosition + gap > plotHeight && (yPosition + marker.TextBlockSize.Height / 2) > plotHeight)
marker.TextAlignmentY = AlignmentY.Top;
if (xPosition - gap < 0 && (xPosition - marker.TextBlockSize.Width / 2) < 0)
marker.TextAlignmentX = AlignmentX.Right;
else if (xPosition + gap > plotWidth && (xPosition + marker.TextBlockSize.Width / 2) > plotWidth)
marker.TextAlignmentX = AlignmentX.Left;
}
}
marker.PixelLavelShadow = false; // pixelLavelShadow;
marker.CreateVisual();
UpdateBubblePositionAccording2XandYValue(dataPoint, plotWidth, plotHeight, false, 0, 0);
bubleChartCanvas.Children.Add(marker.Visual);
bubbleFaces.Parts.Add(marker.MarkerShape);
bubbleFaces.VisualComponents.Add(marker.Visual);
bubbleFaces.BorderElements.Add(marker.MarkerShape);
bubbleFaces.Visual = marker.Visual;
dataPoint.Faces = bubbleFaces;
dataPoint.Faces.Visual.Opacity = dataPoint.Opacity * dataPoint.Parent.Opacity;
dataPoint.AttachEvent2DataPointVisualFaces(dataPoint);
dataPoint.AttachEvent2DataPointVisualFaces(dataPoint.Parent);
dataPoint._parsedToolTipText = dataPoint.TextParser(dataPoint.ToolTipText);
dataPoint.AttachToolTip(chart, dataPoint, dataPoint.Faces.VisualComponents);
dataPoint.AttachHref(chart, dataPoint.Faces.VisualComponents, dataPoint.Href, (HrefTargets)dataPoint.HrefTarget);
dataPoint.SetCursor2DataPointVisualFaces();
if (dataPoint.Parent.SelectionEnabled && dataPoint.Selected)
dataPoint.Select(true);
}