Fixes code according to modern code style. Fixes a few expression bugs.
This commit is contained in:
parent
89eea25e5f
commit
970fd563b2
3324 changed files with 441118 additions and 433755 deletions
|
|
@ -3,61 +3,54 @@ using System.Drawing;
|
|||
|
||||
namespace Server.Engines.Reports
|
||||
{
|
||||
//*********************************************************************
|
||||
//
|
||||
// Chart Class
|
||||
//
|
||||
// Base class implementation for BarChart and PieChart
|
||||
//
|
||||
//*********************************************************************
|
||||
//*********************************************************************
|
||||
//
|
||||
// Chart Class
|
||||
//
|
||||
// Base class implementation for BarChart and PieChart
|
||||
//
|
||||
//*********************************************************************
|
||||
|
||||
public abstract class ChartRenderer
|
||||
{
|
||||
private const int _colorLimit = 9;
|
||||
public abstract class ChartRenderer
|
||||
{
|
||||
private const int _colorLimit = 9;
|
||||
|
||||
private Color[] _color =
|
||||
{
|
||||
Color.Firebrick,
|
||||
Color.SkyBlue,
|
||||
Color.MediumSeaGreen,
|
||||
Color.MediumOrchid,
|
||||
Color.Chocolate,
|
||||
Color.SlateBlue,
|
||||
Color.LightPink,
|
||||
Color.LightGreen,
|
||||
Color.Khaki
|
||||
};
|
||||
private Color[] _color =
|
||||
{
|
||||
Color.Firebrick,
|
||||
Color.SkyBlue,
|
||||
Color.MediumSeaGreen,
|
||||
Color.MediumOrchid,
|
||||
Color.Chocolate,
|
||||
Color.SlateBlue,
|
||||
Color.LightPink,
|
||||
Color.LightGreen,
|
||||
Color.Khaki
|
||||
};
|
||||
|
||||
// Represent collection of all data points for the chart
|
||||
public ChartItemsCollection DataPoints{ get; set; } = new ChartItemsCollection();
|
||||
|
||||
// The implementation of this method is provided by derived classes
|
||||
public abstract Bitmap Draw();
|
||||
// Represent collection of all data points for the chart
|
||||
|
||||
public ChartItemsCollection DataPoints { get; set; } = new ChartItemsCollection();
|
||||
// The implementation of this method is provided by derived classes
|
||||
public abstract Bitmap Draw();
|
||||
|
||||
public void SetColor(int index, Color NewColor)
|
||||
{
|
||||
if (index < _colorLimit)
|
||||
{
|
||||
_color[index] = NewColor;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Exception("Color Limit is " + _colorLimit);
|
||||
}
|
||||
}
|
||||
public void SetColor(int index, Color NewColor)
|
||||
{
|
||||
if (index < _colorLimit)
|
||||
_color[index] = NewColor;
|
||||
else
|
||||
throw new Exception("Color Limit is " + _colorLimit);
|
||||
}
|
||||
|
||||
public Color GetColor(int index)
|
||||
{
|
||||
//return _color[index%_colorLimit];
|
||||
public Color GetColor(int index)
|
||||
{
|
||||
//return _color[index%_colorLimit];
|
||||
|
||||
if (index < _colorLimit)
|
||||
{
|
||||
return _color[index];
|
||||
}
|
||||
if (index < _colorLimit) return _color[index];
|
||||
|
||||
return _color[(index+2)%_colorLimit];
|
||||
//throw new Exception("Color Limit is " + _colorLimit);
|
||||
}
|
||||
}
|
||||
return _color[(index + 2) % _colorLimit];
|
||||
//throw new Exception("Color Limit is " + _colorLimit);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue