-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Delete IValueConverterNS. Fix GridLine bug
- Loading branch information
Showing
33 changed files
with
925 additions
and
492 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Diagnostics; | ||
using System.Linq; | ||
using MvvmCharting.Common; | ||
|
||
namespace MvvmCharting.Axis | ||
{ | ||
public class CategoryAxisDrawingSettings : ICategoryAxisDrawingSettings | ||
{ | ||
|
||
|
||
#region input values | ||
|
||
public IList<object> PlottingItemValues { get; } | ||
|
||
public double PlottingLength { get; } | ||
#endregion | ||
|
||
#region generated values | ||
|
||
public double ActualTickInterval { get; } | ||
|
||
public int ActualTickCount { get; } | ||
|
||
#endregion | ||
|
||
public CategoryAxisDrawingSettings(int tickInterval, IList<object> plottingItemValues, double plottingLength) | ||
{ | ||
if (plottingItemValues == null) | ||
{ | ||
return; | ||
} | ||
|
||
this.PlottingItemValues = plottingItemValues; | ||
|
||
|
||
this.PlottingLength = plottingLength; | ||
|
||
//calculated state: | ||
this.ActualTickInterval = tickInterval; | ||
|
||
this.ActualTickCount = (int)Math.Floor(plottingItemValues.Count / this.ActualTickInterval) + 1; | ||
} | ||
|
||
|
||
public override bool Equals(object obj) | ||
{ | ||
var other = obj as CategoryAxisDrawingSettings; | ||
if (other == null) | ||
{ | ||
return false; | ||
} | ||
|
||
return this.PlottingLength.NearlyEqual(other.PlottingLength, 0.0001) && | ||
this.PlottingItemValues?.Count == other.PlottingItemValues?.Count && | ||
(this.PlottingItemValues != null && this.PlottingItemValues.SequenceEqual(other.PlottingItemValues)) && | ||
this.ActualTickCount == other.ActualTickCount && | ||
this.ActualTickInterval == other.ActualTickInterval; | ||
} | ||
|
||
public bool CanUpdateAxisItems() | ||
{ | ||
|
||
return !this.PlottingLength.IsNaNOrZero() && !this.ActualTickInterval.IsNaNOrZero(); | ||
} | ||
|
||
public bool CanUpdateAxisItemsCoordinate() | ||
{ | ||
return !this.PlottingLength.IsNaNOrZero() && this.PlottingItemValues?.Count > 0; | ||
} | ||
|
||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.