本文整理汇总了C#中System.Windows.Forms.DataVisualization.Charting.Series.IsCustomPropertySet方法的典型用法代码示例。如果您正苦于以下问题:C# Series.IsCustomPropertySet方法的具体用法?C# Series.IsCustomPropertySet怎么用?C# Series.IsCustomPropertySet使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.DataVisualization.Charting.Series
的用法示例。
在下文中一共展示了Series.IsCustomPropertySet方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RemoveCustomPropertyIfExists
protected void RemoveCustomPropertyIfExists(Series series, string property) {
if (series.IsCustomPropertySet(property)) series.DeleteCustomProperty(property);
}
示例2: CreateChartInSeriesPoints
/// <summary>
/// Creates a mini-chart in the data points of the original Point or Bubble chart.
/// </summary>
/// <param name="chart">Chart object.</param>
/// <param name="series">Original data series.</param>
/// <param name="chartType">Mini-chart type.</param>
public void CreateChartInSeriesPoints(Chart chart, Series series, string chartType)
{
//****************************************************
//** Check if series uses X values or they all set
//** to zeros (in this case use point index as X value)
//****************************************************
bool zeroXValues = true;
foreach(DataPoint point in series.Points)
{
if(point.XValue != 0.0)
{
zeroXValues = false;
break;
}
}
//****************************************************
//** Calculate bubble scaling variables required to
//** for the bubble size calculations.
//****************************************************
bool bubbleChart = false;
// Minimum/Maximum bubble size
double maxPossibleBubbleSize = 15F;
double minPossibleBubbleSize = 3F;
float maxBubleSize = 0f;
float minBubleSize = 0f;
// Current min/max size of the bubble size
double minAll = double.MaxValue;
double maxAll = double.MinValue;
// Bubble size difference value
double valueDiff = 0;
double valueScale = 1;
// Check for the Bubble chart type
if( series.ChartType == SeriesChartType.Bubble )
{
bubbleChart = true;
// Check if custom attributes are set to specify scale
if(series.IsCustomPropertySet("BubbleScaleMin"))
{
minAll = Math.Min(minAll, Double.Parse(series["BubbleScaleMin"]));
}
if(series.IsCustomPropertySet("BubbleScaleMax"))
{
maxAll = Math.Max(maxAll, Double.Parse(series["BubbleScaleMax"]));
}
// Calculate bubble scale
double minSer = double.MaxValue;
double maxSer = double.MinValue;
foreach( Series ser in chart.Series )
{
if( ser.ChartType == SeriesChartType.Bubble && ser.ChartArea == series.ChartArea )
{
foreach(DataPoint point in ser.Points)
{
minSer = Math.Min(minSer, point.YValues[1]);
maxSer = Math.Max(maxSer, point.YValues[1]);
}
}
}
if(minAll == double.MaxValue)
{
minAll = minSer;
}
if(maxAll == double.MinValue)
{
maxAll = maxSer;
}
// Calculate maximum bubble size
SizeF areaSize = chart.ChartAreas[series.ChartArea].Position.Size;
// Convert relative coordinates to absolute coordinates
areaSize.Width = areaSize.Width * (chart.Width - 1) / 100F;
areaSize.Height = areaSize.Height * (chart.Height - 1) / 100F;
maxBubleSize = (float)(Math.Min(areaSize.Width, areaSize.Height) / (100.0/maxPossibleBubbleSize));
minBubleSize = (float)(Math.Min(areaSize.Width, areaSize.Height) / (100.0/minPossibleBubbleSize));
// Calculate scaling variables depending on the Min/Max values
if(maxAll == minAll)
{
valueScale = 1;
valueDiff = minAll - (maxBubleSize - minBubleSize)/2f;
}
else
{
valueScale = (maxBubleSize - minBubleSize) / (maxAll - minAll);
valueDiff = minAll;
}
//.........这里部分代码省略.........