using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace RealTimeGraphX
{
///
/// Represents a graph x/y data points boundaries.
///
public interface IGraphRange : IGraphComponent
{
///
/// Gets or sets the maximum x value.
///
GraphDataPoint MaximumX { get; set; }
///
/// Gets or sets the minimum x value.
///
GraphDataPoint MinimumY { get; set; }
///
/// Gets or sets the maximum y value.
///
GraphDataPoint MaximumY { get; set; }
///
/// Gets or sets a value indicating whether to automatically adjust the graph and according to the current effective data points.
///
bool AutoY { get; set; }
}
///
/// Represents a graph X/Y range boundaries.
///
/// Type of x-axis data point.
/// Type of y-axis data point.
///
public class GraphRange : GraphObject, IGraphRange where XDataPoint : GraphDataPoint where YDataPoint : GraphDataPoint
{
private XDataPoint _maximumX;
///
/// Gets or sets the maximum x value.
///
public XDataPoint MaximumX
{
get { return _maximumX; }
set { _maximumX = value; RaisePropertyChangedAuto(); }
}
private YDataPoint _minimumY;
///
/// Gets or sets the minimum x value.
///
public YDataPoint MinimumY
{
get { return _minimumY; }
set { _minimumY = value; RaisePropertyChangedAuto(); }
}
private YDataPoint _maximumY;
///
/// Gets or sets the maximum y value.
///
public YDataPoint MaximumY
{
get { return _maximumY; }
set { _maximumY = value; RaisePropertyChangedAuto(); }
}
private bool _autoY;
///
/// Gets or sets a value indicating whether to automatically adjust the graph and according to the current visible data points.
///
public bool AutoY
{
get { return _autoY; }
set { _autoY = value; RaisePropertyChangedAuto(); }
}
///
/// Initializes a new instance of the class.
///
public GraphRange()
{
MinimumY = GraphDataPointHelper.Init();
MaximumX = GraphDataPointHelper.Init();
MaximumY = GraphDataPointHelper.Init();
}
///
/// Gets or sets the maximum x value.
///
GraphDataPoint IGraphRange.MaximumX
{
get
{
return MaximumX;
}
set
{
MaximumX = (XDataPoint)value;
}
}
///
/// Gets or sets the minimum x value.
///
GraphDataPoint IGraphRange.MinimumY
{
get
{
return MinimumY;
}
set
{
MinimumY = (YDataPoint)value;
}
}
///
/// Gets or sets the maximum y value.
///
GraphDataPoint IGraphRange.MaximumY
{
get
{
return MaximumY;
}
set
{
MaximumY = (YDataPoint)value;
}
}
}
}