* UIBarChart:修正一个显示的Bug
This commit is contained in:
parent
dafc427626
commit
79bced975f
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -26,26 +26,26 @@ namespace Sunny.UI.Demo
|
||||
|
||||
var series = new UIBarSeries();
|
||||
series.Name = "Bar1";
|
||||
series.AddData(-1);
|
||||
series.AddData(-1);
|
||||
series.AddData(-1);
|
||||
series.AddData(-1);
|
||||
series.AddData(-1);
|
||||
series.AddData(1);
|
||||
series.AddData(1);
|
||||
series.AddData(1);
|
||||
series.AddData(-1.1);
|
||||
series.AddData(-1.1);
|
||||
series.AddData(-1.1);
|
||||
series.AddData(-1.1);
|
||||
series.AddData(-1.1);
|
||||
series.AddData(-1.1);
|
||||
series.AddData(-1.1);
|
||||
series.AddData(-1.1);
|
||||
option.Series.Add(series);
|
||||
|
||||
series = new UIBarSeries();
|
||||
series.Name = "Bar2";
|
||||
series.AddData(1.1);
|
||||
series.AddData(1.1);
|
||||
series.AddData(1.1);
|
||||
series.AddData(1.1);
|
||||
series.AddData(1.1);
|
||||
series.AddData(1.1);
|
||||
series.AddData(1.1);
|
||||
series.AddData(1.1);
|
||||
series.AddData(-1.1);
|
||||
series.AddData(-1.1);
|
||||
series.AddData(-1.1);
|
||||
series.AddData(-1.1);
|
||||
series.AddData(-1.1);
|
||||
series.AddData(-1.1);
|
||||
series.AddData(-1.1);
|
||||
series.AddData(-1.1);
|
||||
option.Series.Add(series);
|
||||
|
||||
option.XAxis.Data.Add("D1");
|
||||
|
@ -139,16 +139,24 @@ namespace Sunny.UI
|
||||
if (!Option.YAxis.MaxAuto) max = Option.YAxis.Max;
|
||||
if (!Option.YAxis.MinAuto) min = Option.YAxis.Min;
|
||||
|
||||
if ((max - min).IsZero() && min.IsZero())
|
||||
if ((max - min).IsZero())
|
||||
{
|
||||
max = 100;
|
||||
min = 0;
|
||||
if (min.IsZero())
|
||||
{
|
||||
max = 100;
|
||||
min = 0;
|
||||
}
|
||||
else if (max > 0)
|
||||
{
|
||||
max = max * 2;
|
||||
min = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
max = 0;
|
||||
min = min * 2;
|
||||
}
|
||||
}
|
||||
//else
|
||||
//{
|
||||
// if (max > 0) min = 0;
|
||||
// else max = 0;
|
||||
//}
|
||||
|
||||
CalcDegreeScale(min, max, Option.YAxis.SplitNumber,
|
||||
out int start, out int end, out double interval, out int decimalCount);
|
||||
|
@ -67,15 +67,23 @@ namespace Sunny.UI
|
||||
if (!Option.YAxis.MaxAuto) max = Option.YAxis.Max;
|
||||
if (!Option.YAxis.MinAuto) min = Option.YAxis.Min;
|
||||
|
||||
if ((max - min).IsZero() && min.IsZero())
|
||||
if ((max - min).IsZero())
|
||||
{
|
||||
max = 100;
|
||||
min = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (max > 0) min = 0;
|
||||
else max = 0;
|
||||
if (min.IsZero())
|
||||
{
|
||||
max = 100;
|
||||
min = 0;
|
||||
}
|
||||
else if (max > 0)
|
||||
{
|
||||
max = max * 2;
|
||||
min = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
max = 0;
|
||||
min = min * 2;
|
||||
}
|
||||
}
|
||||
|
||||
CalcDegreeScale(min, max, Option.YAxis.SplitNumber,
|
||||
|
Loading…
x
Reference in New Issue
Block a user