示例#1
0
        internal void UpdateVisibleInLegend(DataPointBinding visibleInLegendBinding)
        {
            var oldVisibleInLegend = this.visibleInLegend;

            if (visibleInLegendBinding != null && this.point.dataItem != null)
            {
                this.visibleInLegend = (bool)visibleInLegendBinding.GetValue(this.point.dataItem);
            }

            if (oldVisibleInLegend != this.visibleInLegend && this.ParentSeries != null)
            {
                if (this.visibleInLegend)
                {
                    // TODO: Consider better solution for the scenario with runtime rebind of the control (pie segment reuse could be incorrectly interpreted as property change here).
                    // i.e. the data point at index i in the original source did not display in the legend, but the data point at the same index in the new source should be --
                    // as both data points are associated with the same segment -- we will end up with duplicates in the LegendInfos collection unless we add this check condition.
                    if (!this.ParentSeries.LegendInfos.Contains(this.legendItem))
                    {
                        this.ParentSeries.LegendInfos.Add(this.legendItem);
                    }
                }
                else
                {
                    this.ParentSeries.LegendInfos.Remove(this.legendItem);
                }
            }
        }
示例#2
0
        internal void UpdateLegendTitle(DataPointBinding legendTitleBinding)
        {
            object data = null;

            if (legendTitleBinding != null && this.point.dataItem != null)
            {
                data = legendTitleBinding.GetValue(this.point.dataItem);
            }

            if (data != null)
            {
                this.legendItem.Title = data.ToString();
            }

            if (this.legendItem.Title == null || data == null)
            {
                this.legendItem.Title = this.point.Label.ToString();
            }
        }
        internal static double CalculateValue(DataPointBinding highBinding, DataPointBinding lowBinding, DataPointBinding closeBinding, object previousItem, object currentItem)
        {
            double previousClose, high, low, value;

            high = (double)highBinding.GetValue(currentItem);
            low  = (double)lowBinding.GetValue(currentItem);
            if (previousItem != null)
            {
                previousClose = (double)closeBinding.GetValue(previousItem);
            }
            else
            {
                previousClose = (double)closeBinding.GetValue(currentItem);
            }

            value = high - low;

            if (previousItem != null)
            {
                value = CalculateValue(previousClose, low, high);
            }

            return(value);
        }
示例#4
0
 /// <summary>
 /// Called when <seealso cref="PolarSeries.ValueBinding"/> has changed.
 /// </summary>
 /// <param name="oldValue">The old value.</param>
 /// <param name="newValue">The new value.</param>
 protected virtual void OnValueBindingChanged(DataPointBinding oldValue, DataPointBinding newValue)
 {
 }
示例#5
0
 /// <summary>
 /// Called when <seealso cref="PolarSeries.ValueBinding" /> has changed.
 /// </summary>
 /// <param name="oldValue">The old value.</param>
 /// <param name="newValue">The new value.</param>
 protected override void OnValueBindingChanged(DataPointBinding oldValue, DataPointBinding newValue)
 {
     (this.dataSource as CategoricalSeriesDataSource).ValueBinding = newValue;
 }