mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-28 20:28:46 +00:00
修复Log轴时绘制异常的问题
This commit is contained in:
@@ -86,10 +86,19 @@ namespace XCharts
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
valueTotal = xMaxValue - xMinValue;
|
if (yAxis.IsLog())
|
||||||
if (valueTotal != 0)
|
{
|
||||||
barHig = (xMinValue > 0 ? value - xMinValue : value)
|
int minIndex = xAxis.runtimeMinLogIndex;
|
||||||
/ valueTotal * grid.runtimeWidth;
|
float nowIndex = xAxis.GetLogValue(value);
|
||||||
|
barHig = (nowIndex - minIndex) / xAxis.splitNumber * grid.runtimeWidth;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
valueTotal = xMaxValue - xMinValue;
|
||||||
|
if (valueTotal != 0)
|
||||||
|
barHig = (xMinValue > 0 ? value - xMinValue : value)
|
||||||
|
/ valueTotal * grid.runtimeWidth;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
serieData.runtimeStackHig = barHig;
|
serieData.runtimeStackHig = barHig;
|
||||||
var isBarEnd = false;
|
var isBarEnd = false;
|
||||||
@@ -223,7 +232,16 @@ namespace XCharts
|
|||||||
valueTotal = yMaxValue - yMinValue;
|
valueTotal = yMaxValue - yMinValue;
|
||||||
if (valueTotal != 0)
|
if (valueTotal != 0)
|
||||||
{
|
{
|
||||||
barHig = (yMinValue > 0 ? value - yMinValue : value) / valueTotal * grid.runtimeHeight;
|
if (yAxis.IsLog())
|
||||||
|
{
|
||||||
|
int minIndex = yAxis.runtimeMinLogIndex;
|
||||||
|
float nowIndex = yAxis.GetLogValue(value);
|
||||||
|
barHig = (nowIndex - minIndex) / yAxis.splitNumber * grid.runtimeHeight;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
barHig = (yMinValue > 0 ? value - yMinValue : value) / valueTotal * grid.runtimeHeight;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
serieData.runtimeStackHig = barHig;
|
serieData.runtimeStackHig = barHig;
|
||||||
|
|||||||
@@ -440,7 +440,7 @@ namespace XCharts
|
|||||||
{
|
{
|
||||||
int minIndex = xAxis.runtimeMinLogIndex;
|
int minIndex = xAxis.runtimeMinLogIndex;
|
||||||
float nowIndex = xAxis.GetLogValue(xValue);
|
float nowIndex = xAxis.GetLogValue(xValue);
|
||||||
xDataHig = (nowIndex - minIndex) / (xAxis.splitNumber - 1) * grid.runtimeWidth;
|
xDataHig = (nowIndex - minIndex) / xAxis.splitNumber * grid.runtimeWidth;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -451,7 +451,7 @@ namespace XCharts
|
|||||||
{
|
{
|
||||||
int minIndex = yAxis.runtimeMinLogIndex;
|
int minIndex = yAxis.runtimeMinLogIndex;
|
||||||
float nowIndex = yAxis.GetLogValue(yValue);
|
float nowIndex = yAxis.GetLogValue(yValue);
|
||||||
yDataHig = (nowIndex - minIndex) / (yAxis.splitNumber - 1) * grid.runtimeHeight;
|
yDataHig = (nowIndex - minIndex) / yAxis.splitNumber * grid.runtimeHeight;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -477,7 +477,7 @@ namespace XCharts
|
|||||||
{
|
{
|
||||||
int minIndex = yAxis.runtimeMinLogIndex;
|
int minIndex = yAxis.runtimeMinLogIndex;
|
||||||
float nowIndex = yAxis.GetLogValue(yValue);
|
float nowIndex = yAxis.GetLogValue(yValue);
|
||||||
yDataHig = (nowIndex - minIndex) / (yAxis.splitNumber - 1) * grid.runtimeHeight;
|
yDataHig = (nowIndex - minIndex) / yAxis.splitNumber * grid.runtimeHeight;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -577,7 +577,7 @@ namespace XCharts
|
|||||||
{
|
{
|
||||||
int minIndex = xAxis.runtimeMinLogIndex;
|
int minIndex = xAxis.runtimeMinLogIndex;
|
||||||
float nowIndex = xAxis.GetLogValue(value);
|
float nowIndex = xAxis.GetLogValue(value);
|
||||||
dataHig = (nowIndex - minIndex) / (xAxis.splitNumber - 1) * grid.runtimeWidth;
|
dataHig = (nowIndex - minIndex) / xAxis.splitNumber * grid.runtimeWidth;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ namespace XCharts
|
|||||||
{
|
{
|
||||||
int minIndex = axis.runtimeMinLogIndex;
|
int minIndex = axis.runtimeMinLogIndex;
|
||||||
float nowIndex = axis.GetLogValue(value);
|
float nowIndex = axis.GetLogValue(value);
|
||||||
return (nowIndex - minIndex) / (axis.splitNumber - 1) * totalWidth;
|
return (nowIndex - minIndex) / axis.splitNumber * totalWidth;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user