优化多条k线图显示

This commit is contained in:
monitor1394
2021-03-12 07:16:20 +08:00
parent 555e6d47ca
commit da305e3b7a

View File

@@ -23,11 +23,9 @@ namespace XCharts
var grid = GetSerieGridOrDefault(serie);
float categoryWidth = AxisHelper.GetDataWidth(xAxis, grid.runtimeWidth, showData.Count, dataZoom);
float barGap = GetBarGap();
float totalBarWidth = GetBarTotalWidth(categoryWidth, barGap);
float barWidth = serie.GetBarWidth(categoryWidth);
float offset = (categoryWidth - totalBarWidth) / 2;
float space = (categoryWidth - barWidth) / 2;
float barGapWidth = barWidth + barWidth * barGap;
float space = serie.barGap == -1 ? offset : offset + GetBarIndex(serie) * barGapWidth;
int maxCount = serie.maxShow > 0
? (serie.maxShow > showData.Count ? showData.Count : serie.maxShow)
: showData.Count;