Skip to content

Commit

Permalink
updated PCL
Browse files Browse the repository at this point in the history
  • Loading branch information
beto-rodriguez committed Feb 6, 2017
1 parent fea4c8f commit 8e79f23
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 6 deletions.
2 changes: 2 additions & 0 deletions Core/ChartUpdater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ protected void Update(bool restartsAnimations = false)

foreach (var series in Chart.View.ActualSeries)
{
if (Chart.View.ContainsElement(series)) continue;

InitializeSeriesView(series);
series.ActualValues.Initialize(series);
series.InitializeColors();
Expand Down
8 changes: 2 additions & 6 deletions Core/Charts/CartesianChartCore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -145,13 +145,9 @@ public override void PrepareAxes()
/// </summary>
public override void RunSpecializedChartComponents()
{
var cartesianChart = (ICartesianChart) View;
if (cartesianChart.VisualElements != null)
foreach (var visualElement in ((ICartesianChart) View).VisualElements)
{
foreach (var visualElement in cartesianChart.VisualElements)
{
visualElement.AddOrMove(this);
}
visualElement.AddOrMove(this);
}
}

Expand Down
10 changes: 10 additions & 0 deletions Core/Configurations/Mappers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,5 +76,15 @@ public static PolarMapper<T> Polar<T>()
{
return new PolarMapper<T>();
}

/// <summary>
/// PGets a mapper to configure a pie chart
/// </summary>
/// <typeparam name="T"></typeparam>
/// <returns></returns>
public static PieMapper<T> Pie<T>()
{
return new PieMapper<T>();
}
}
}
5 changes: 5 additions & 0 deletions Core/Definitions/Charts/IChartView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,11 @@ public interface IChartView
/// </summary>
/// <param name="element">The element.</param>
void EnsureElementBelongsToCurrentDrawMargin(object element);
/// <summary>
/// Determines whether the specified element contains element.
/// </summary>
/// <param name="element">The element.</param>
bool ContainsElement(object element);

/// <summary>
/// Hides the tooltip.
Expand Down
11 changes: 11 additions & 0 deletions UwpView/Charts/Base/Chart.cs
Original file line number Diff line number Diff line change
Expand Up @@ -757,6 +757,17 @@ public void EnsureElementBelongsToCurrentDrawMargin(object element)
AddToDrawMargin(wpfElement);
}

/// <summary>
/// Determines whether the specified element contains element.
/// </summary>
/// <param name="element">The element.</param>
/// <returns></returns>
public bool ContainsElement(object element)
{
var wpfElement = (FrameworkElement)element;
return wpfElement != null && Canvas.Children.Contains(wpfElement);
}

/// <summary>
/// Shows the legend.
/// </summary>
Expand Down

0 comments on commit 8e79f23

Please sign in to comment.