* 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();
|
var series = new UIBarSeries();
|
||||||
series.Name = "Bar1";
|
series.Name = "Bar1";
|
||||||
series.AddData(-1);
|
series.AddData(-1.1);
|
||||||
series.AddData(-1);
|
series.AddData(-1.1);
|
||||||
series.AddData(-1);
|
series.AddData(-1.1);
|
||||||
series.AddData(-1);
|
series.AddData(-1.1);
|
||||||
series.AddData(-1);
|
series.AddData(-1.1);
|
||||||
series.AddData(1);
|
series.AddData(-1.1);
|
||||||
series.AddData(1);
|
series.AddData(-1.1);
|
||||||
series.AddData(1);
|
series.AddData(-1.1);
|
||||||
option.Series.Add(series);
|
option.Series.Add(series);
|
||||||
|
|
||||||
series = new UIBarSeries();
|
series = new UIBarSeries();
|
||||||
series.Name = "Bar2";
|
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.Series.Add(series);
|
||||||
|
|
||||||
option.XAxis.Data.Add("D1");
|
option.XAxis.Data.Add("D1");
|
||||||
|
@ -139,16 +139,24 @@ namespace Sunny.UI
|
|||||||
if (!Option.YAxis.MaxAuto) max = Option.YAxis.Max;
|
if (!Option.YAxis.MaxAuto) max = Option.YAxis.Max;
|
||||||
if (!Option.YAxis.MinAuto) min = Option.YAxis.Min;
|
if (!Option.YAxis.MinAuto) min = Option.YAxis.Min;
|
||||||
|
|
||||||
if ((max - min).IsZero() && min.IsZero())
|
if ((max - min).IsZero())
|
||||||
{
|
{
|
||||||
max = 100;
|
if (min.IsZero())
|
||||||
min = 0;
|
{
|
||||||
|
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,
|
CalcDegreeScale(min, max, Option.YAxis.SplitNumber,
|
||||||
out int start, out int end, out double interval, out int decimalCount);
|
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.MaxAuto) max = Option.YAxis.Max;
|
||||||
if (!Option.YAxis.MinAuto) min = Option.YAxis.Min;
|
if (!Option.YAxis.MinAuto) min = Option.YAxis.Min;
|
||||||
|
|
||||||
if ((max - min).IsZero() && min.IsZero())
|
if ((max - min).IsZero())
|
||||||
{
|
{
|
||||||
max = 100;
|
if (min.IsZero())
|
||||||
min = 0;
|
{
|
||||||
}
|
max = 100;
|
||||||
else
|
min = 0;
|
||||||
{
|
}
|
||||||
if (max > 0) min = 0;
|
else if (max > 0)
|
||||||
else max = 0;
|
{
|
||||||
|
max = max * 2;
|
||||||
|
min = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
max = 0;
|
||||||
|
min = min * 2;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CalcDegreeScale(min, max, Option.YAxis.SplitNumber,
|
CalcDegreeScale(min, max, Option.YAxis.SplitNumber,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user