项目结构调整

This commit is contained in:
艾竹
2023-04-16 20:11:40 +08:00
parent cbfbf96033
commit 81f91f3f35
2124 changed files with 218 additions and 5516 deletions

View File

@@ -0,0 +1,64 @@
//The MIT License(MIT)
//Copyright(c) 2016 Alberto Rodriguez & LiveCharts Contributors
//Permission is hereby granted, free of charge, to any person obtaining a copy
//of this software and associated documentation files (the "Software"), to deal
//in the Software without restriction, including without limitation the rights
//to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
//copies of the Software, and to permit persons to whom the Software is
//furnished to do so, subject to the following conditions:
//The above copyright notice and this permission notice shall be included in all
//copies or substantial portions of the Software.
//THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
//IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
//FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
//AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
//LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
//OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
//SOFTWARE.
using System;
namespace LiveCharts.Defaults
{
internal static class AxisLimits
{
internal static double StretchMax(AxisCore axis)
{
return axis.TopLimit; //Math.Ceiling(axis.TopLimit/axis.Magnitude)*axis.Magnitude;
}
internal static double StretchMin(AxisCore axis)
{
return axis.BotLimit; //Math.Floor(axis.BotLimit/axis.Magnitude)*axis.Magnitude;
}
internal static double UnitRight(AxisCore axis)
{
return Math.Ceiling(axis.TopLimit/axis.Magnitude)*axis.Magnitude + 1;
}
internal static double UnitLeft(AxisCore axis)
{
return Math.Floor(axis.BotLimit/axis.Magnitude)*axis.Magnitude - 1;
}
internal static double SeparatorMax(AxisCore axis)
{
return ((int) (axis.TopLimit/axis.S) + 1)*axis.S;
}
internal static double SeparatorMaxRounded(AxisCore axis)
{
return Math.Round((axis.TopLimit/axis.S) + 1, 0)*axis.S;
}
internal static double SeparatorMin(AxisCore axis)
{
return (((int) (axis.BotLimit/axis.S)) - 1)*axis.S;
}
}
}

View File

@@ -0,0 +1,93 @@
//The MIT License(MIT)
//Copyright(c) 2016 Alberto Rodriguez & LiveCharts Contributors
//Permission is hereby granted, free of charge, to any person obtaining a copy
//of this software and associated documentation files (the "Software"), to deal
//in the Software without restriction, including without limitation the rights
//to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
//copies of the Software, and to permit persons to whom the Software is
//furnished to do so, subject to the following conditions:
//The above copyright notice and this permission notice shall be included in all
//copies or substantial portions of the Software.
//THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
//IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
//FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
//AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
//LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
//OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
//SOFTWARE.
using System;
namespace LiveCharts.Defaults
{
/// <summary>
/// An already configured chart point with a date time and a double properties, this class notifies the chart to update every time a property changes
/// </summary>
public class DateTimePoint : IObservableChartPoint
{
private DateTime _dateTime;
private double _value;
/// <summary>
/// Initializes a new instance of DateTimePoint class
/// </summary>
public DateTimePoint()
{
}
/// <summary>
/// Initializes a new instance of DateTimePoint class, giving date time and value
/// </summary>
/// <param name="dateTime"></param>
/// <param name="value"></param>
public DateTimePoint(DateTime dateTime, double value)
{
_dateTime = dateTime;
_value = value;
}
/// <summary>
/// DateTime Property
/// </summary>
public DateTime DateTime
{
get { return _dateTime; }
set
{
_dateTime = value;
OnPointChanged();
}
}
/// <summary>
/// The Value property
/// </summary>
public double Value
{
get { return _value; }
set
{
_value = value;
OnPointChanged();
}
}
/// <summary>
/// Point changed event
/// </summary>
public event Action PointChanged;
/// <summary>
/// On Point property changed method
/// </summary>
protected virtual void OnPointChanged()
{
if (PointChanged != null) PointChanged.Invoke();
}
}
}

View File

@@ -0,0 +1,92 @@
//The MIT License(MIT)
//Copyright(c) 2016 Alberto Rodriguez & LiveCharts Contributors
//Permission is hereby granted, free of charge, to any person obtaining a copy
//of this software and associated documentation files (the "Software"), to deal
//in the Software without restriction, including without limitation the rights
//to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
//copies of the Software, and to permit persons to whom the Software is
//furnished to do so, subject to the following conditions:
//The above copyright notice and this permission notice shall be included in all
//copies or substantial portions of the Software.
//THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
//IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
//FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
//AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
//LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
//OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
//SOFTWARE.
using System;
namespace LiveCharts.Defaults
{
/// <summary>
/// Defines a Gantt point in a cartesian chart
/// </summary>
public class GanttPoint : IObservableChartPoint
{
private double _startPoint;
private double _endPoint;
/// <summary>
/// Initializes a new instance of GanttPoint class.
/// </summary>
public GanttPoint()
{
}
/// <summary>
/// Initializes a new instance of GanttPoint class with given start and end points.
/// </summary>
public GanttPoint(double startPoint, double endPoint)
{
StartPoint = startPoint;
EndPoint = endPoint;
}
/// <summary>
/// Gets or sets point start
/// </summary>
public double StartPoint
{
get { return _startPoint; }
set
{
_startPoint = value;
OnPointChanged();
}
}
/// <summary>
/// Gets or sets point end
/// </summary>
public double EndPoint
{
get { return _endPoint; }
set
{
_endPoint = value;
OnPointChanged();
}
}
/// <summary>
/// PointChanged event
/// </summary>
public event Action PointChanged;
/// <summary>
/// OnPoint property changed method
/// </summary>
protected virtual void OnPointChanged()
{
if (PointChanged != null)
PointChanged.Invoke();
}
}
}

View File

@@ -0,0 +1,51 @@
//The MIT License(MIT)
//Copyright(c) 2016 Alberto Rodriguez & LiveCharts Contributors
//Permission is hereby granted, free of charge, to any person obtaining a copy
//of this software and associated documentation files (the "Software"), to deal
//in the Software without restriction, including without limitation the rights
//to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
//copies of the Software, and to permit persons to whom the Software is
//furnished to do so, subject to the following conditions:
//The above copyright notice and this permission notice shall be included in all
//copies or substantial portions of the Software.
//THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
//IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
//FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
//AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
//LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
//OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
//SOFTWARE.
namespace LiveCharts.Defaults
{
/// <summary>
/// An already configured weighted chart point, this class notifies the chart to update every time a property changes
/// </summary>
public class HeatPoint : ScatterPoint
{
/// <summary>
/// Initializes a new instance of HeatPoint class
/// </summary>
public HeatPoint()
{
}
/// <summary>
/// _initializes a new instance of HeatPoint class, giving x, y and weight
/// </summary>
/// <param name="x"></param>
/// <param name="y"></param>
/// <param name="weight"></param>
public HeatPoint(double x, double y, double weight)
{
X = x;
Y = y;
Weight = weight;
}
}
}

View File

@@ -0,0 +1,125 @@
//The MIT License(MIT)
//Copyright(c) 2016 Alberto Rodriguez & LiveCharts Contributors
//Permission is hereby granted, free of charge, to any person obtaining a copy
//of this software and associated documentation files (the "Software"), to deal
//in the Software without restriction, including without limitation the rights
//to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
//copies of the Software, and to permit persons to whom the Software is
//furnished to do so, subject to the following conditions:
//The above copyright notice and this permission notice shall be included in all
//copies or substantial portions of the Software.
//THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
//IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
//FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
//AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
//LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
//OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
//SOFTWARE.
using System;
namespace LiveCharts.Defaults
{
/// <summary>
/// An already configured chart point, this class notifies the chart to update every time a property changes
/// </summary>
public class OhlcPoint : IObservableChartPoint
{
private double _open;
private double _high;
private double _low;
private double _close;
/// <summary>
/// Initializes a new instance of OhclPoint class
/// </summary>
public OhlcPoint()
{
}
/// <summary>
/// Initializes a new instance o OhclPointc class, giving open, high, low and close values
/// </summary>
/// <param name="open"></param>
/// <param name="high"></param>
/// <param name="low"></param>
/// <param name="close"></param>
public OhlcPoint(double open, double high, double low, double close)
{
Open = open;
High = high;
Low = low;
Close = close;
}
/// <summary>
/// The open value i the chart
/// </summary>
public double Open
{
get { return _open; }
set
{
_open = value;
OnPointChanged();
}
}
/// <summary>
/// The high value in the chart
/// </summary>
public double High
{
get { return _high; }
set
{
_high = value;
OnPointChanged();
}
}
/// <summary>
/// The low value in the chart
/// </summary>
public double Low
{
get { return _low; }
set
{
_low = value;
OnPointChanged();
}
}
/// <summary>
/// The close value in the chart
/// </summary>
public double Close
{
get { return _close; }
set
{
_close = value;
OnPointChanged();
}
}
/// <summary>
/// The Point changed event
/// </summary>
public event Action PointChanged;
/// <summary>
/// On point property changed method
/// </summary>
protected virtual void OnPointChanged()
{
if (PointChanged != null) PointChanged.Invoke();
}
}
}

View File

@@ -0,0 +1,93 @@
//The MIT License(MIT)
//Copyright(c) 2016 Alberto Rodriguez & LiveCharts Contributors
//Permission is hereby granted, free of charge, to any person obtaining a copy
//of this software and associated documentation files (the "Software"), to deal
//in the Software without restriction, including without limitation the rights
//to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
//copies of the Software, and to permit persons to whom the Software is
//furnished to do so, subject to the following conditions:
//The above copyright notice and this permission notice shall be included in all
//copies or substantial portions of the Software.
//THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
//IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
//FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
//AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
//LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
//OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
//SOFTWARE.
using System;
namespace LiveCharts.Defaults
{
/// <summary>
/// An already configured chart point, this class notifies a chart to update every time a property changes
/// </summary>
public class ObservablePoint : IObservableChartPoint
{
private double _x;
private double _y;
/// <summary>
/// The point changed event
/// </summary>
public event Action PointChanged;
/// <summary>
/// Initializes a new instance of ObservablePoint class
/// </summary>
public ObservablePoint()
{
}
/// <summary>
/// Initializes a new instance of ObservablePoint class giving the x and y coordinates
/// </summary>
/// <param name="x"></param>
/// <param name="y"></param>
public ObservablePoint(double x, double y)
{
X = x;
Y = y;
}
/// <summary>
/// X coordinate
/// </summary>
public double X
{
get { return _x; }
set
{
_x = value;
OnPointChanged();
}
}
/// <summary>
/// Y coordinate
/// </summary>
public double Y
{
get { return _y; }
set
{
_y = value;
OnPointChanged();
}
}
/// <summary>
/// OnPoint property changed method
/// </summary>
protected virtual void OnPointChanged()
{
if (PointChanged != null)
PointChanged.Invoke();
}
}
}

View File

@@ -0,0 +1,76 @@
//The MIT License(MIT)
//Copyright(c) 2016 Alberto Rodriguez & LiveCharts Contributors
//Permission is hereby granted, free of charge, to any person obtaining a copy
//of this software and associated documentation files (the "Software"), to deal
//in the Software without restriction, including without limitation the rights
//to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
//copies of the Software, and to permit persons to whom the Software is
//furnished to do so, subject to the following conditions:
//The above copyright notice and this permission notice shall be included in all
//copies or substantial portions of the Software.
//THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
//IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
//FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
//AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
//LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
//OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
//SOFTWARE.
using System;
namespace LiveCharts.Defaults
{
/// <summary>
/// An already configured chart point, this class notifies the chart to update every time the value property changes
/// </summary>
public class ObservableValue : IObservableChartPoint
{
private double _value;
/// <summary>
/// Initializes a new instance of ObservableValue class
/// </summary>
public ObservableValue()
{
}
/// <summary>
/// Initializes a new instance of ObservableValue class with a given value
/// </summary>
/// <param name="value"></param>
public ObservableValue(double value)
{
Value = value;
}
/// <summary>
/// Point changed event
/// </summary>
public event Action PointChanged;
/// <summary>
/// Value in he chart
/// </summary>
public double Value
{
get { return _value; }
set
{
_value = value;
OnPointChanged();
}
}
/// <summary>
/// On point property changed event
/// </summary>
protected virtual void OnPointChanged()
{
if (PointChanged != null) PointChanged.Invoke();
}
}
}

View File

@@ -0,0 +1,93 @@
//The MIT License(MIT)
//Copyright(c) 2016 Alberto Rodriguez & LiveCharts Contributors
//Permission is hereby granted, free of charge, to any person obtaining a copy
//of this software and associated documentation files (the "Software"), to deal
//in the Software without restriction, including without limitation the rights
//to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
//copies of the Software, and to permit persons to whom the Software is
//furnished to do so, subject to the following conditions:
//The above copyright notice and this permission notice shall be included in all
//copies or substantial portions of the Software.
//THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
//IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
//FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
//AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
//LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
//OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
//SOFTWARE.
using System;
namespace LiveCharts.Defaults
{
/// <summary>
/// An already configured chart point, this class notifies the chart to update every time a property changes
/// </summary>
public class PolarPoint : IObservableChartPoint
{
private double _radius;
private double _angle;
/// <summary>
/// The point changed event
/// </summary>
public event Action PointChanged;
/// <summary>
/// Initializes a new instance of PolarPoint class
/// </summary>
public PolarPoint()
{
}
/// <summary>
/// Initializes a new instance of PolarPoint class, giving angle and radius
/// </summary>
/// <param name="radius"></param>
/// <param name="angle"></param>
public PolarPoint(double radius, double angle)
{
Radius = radius;
Angle = angle;
}
/// <summary>
/// The radius of the point
/// </summary>
public double Radius
{
get { return _radius; }
set
{
_radius = value;
OnPointChanged();
}
}
/// <summary>
/// The angle of the point
/// </summary>
public double Angle
{
get { return _angle; }
set
{
_angle = value;
OnPointChanged();
}
}
/// <summary>
/// On point property changed method
/// </summary>
protected virtual void OnPointChanged()
{
if (PointChanged != null)PointChanged.Invoke();
}
}
}

View File

@@ -0,0 +1,120 @@
//The MIT License(MIT)
//Copyright(c) 2016 Alberto Rodriguez & LiveCharts Contributors
//Permission is hereby granted, free of charge, to any person obtaining a copy
//of this software and associated documentation files (the "Software"), to deal
//in the Software without restriction, including without limitation the rights
//to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
//copies of the Software, and to permit persons to whom the Software is
//furnished to do so, subject to the following conditions:
//The above copyright notice and this permission notice shall be included in all
//copies or substantial portions of the Software.
//THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
//IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
//FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
//AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
//LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
//OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
//SOFTWARE.
using System;
namespace LiveCharts.Defaults
{
/// <summary>
/// An already configured weighted chart point, this class notifies the chart to update every time a property changes
/// </summary>
public class ScatterPoint : IObservableChartPoint
{
private double _x;
private double _y;
private double _weight;
/// <summary>
/// Creates a new instance of BubblePoint class
/// </summary>
public ScatterPoint()
{
}
/// <summary>
/// Create a new instance of BubblePoint class, giving x and y coordinates
/// </summary>
/// <param name="x"></param>
/// <param name="y"></param>
public ScatterPoint(double x, double y)
{
X = x;
Y = y;
}
/// <summary>
/// Creates a new instance of BubblePoint class, giving x, y and weight
/// </summary>
/// <param name="x"></param>
/// <param name="y"></param>
/// <param name="weight"></param>
public ScatterPoint(double x, double y, double weight)
{
X = x;
Y = y;
Weight = weight;
}
/// <summary>
/// X coordinate in the chart
/// </summary>
public double X
{
get { return _x; }
set
{
_x = value;
OnPointChanged();
}
}
/// <summary>
/// Y coordinate in the chart
/// </summary>
public double Y
{
get { return _y; }
set
{
_y = value;
OnPointChanged();
}
}
/// <summary>
/// Point's weight
/// </summary>
public double Weight
{
get { return _weight; }
set
{
_weight = value;
OnPointChanged();
}
}
/// <summary>
/// Point changed event
/// </summary>
public event Action PointChanged;
/// <summary>
/// On point property changed method
/// </summary>
protected virtual void OnPointChanged()
{
if (PointChanged != null) PointChanged.Invoke();
}
}
}