mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-24 09:50:15 +00:00
[feature][polar] support multiple bar and stack bar in polar
This commit is contained in:
@@ -116,11 +116,12 @@ namespace XCharts.Runtime
|
||||
for (int i = 1; i < size; i++)
|
||||
{
|
||||
var scaleWidth = AxisHelper.GetScaleWidth(angleAxis, total, i);
|
||||
var pos = ChartHelper.GetPos(cenPos, radius, currAngle, true);
|
||||
var pos1 = ChartHelper.GetPos(cenPos, polar.context.insideRadius, currAngle, true);
|
||||
var pos2 = ChartHelper.GetPos(cenPos, polar.context.outsideRadius, currAngle, true);
|
||||
if (angleAxis.show && angleAxis.splitLine.show)
|
||||
{
|
||||
var lineWidth = angleAxis.splitLine.GetWidth(chart.theme.axis.splitLineWidth);
|
||||
UGL.DrawLine(vh, cenPos, pos, lineWidth, splitLineColor);
|
||||
UGL.DrawLine(vh, pos1, pos2, lineWidth, splitLineColor);
|
||||
}
|
||||
if (angleAxis.show && angleAxis.axisTick.show)
|
||||
{
|
||||
@@ -130,7 +131,7 @@ namespace XCharts.Runtime
|
||||
{
|
||||
var tickY = radius + tickLength;
|
||||
var tickPos = ChartHelper.GetPos(cenPos, tickY, currAngle, true);
|
||||
UGL.DrawLine(vh, pos, tickPos, tickWidth, tickColor);
|
||||
UGL.DrawLine(vh, pos2, tickPos, tickWidth, tickColor);
|
||||
}
|
||||
}
|
||||
currAngle += scaleWidth;
|
||||
|
||||
@@ -135,6 +135,10 @@ namespace XCharts.Runtime
|
||||
var tickLength = axis.axisTick.GetLength(chart.theme.axis.tickLength);
|
||||
var tickVector = ChartHelper.GetVertialDire(dire) *
|
||||
(tickLength + axis.axisLabel.distance);
|
||||
if (axis.IsCategory())
|
||||
{
|
||||
totalWidth += polar.context.radius / axis.data.Count / 2;
|
||||
}
|
||||
return ChartHelper.GetPos(cenPos, totalWidth, startAngle, true) + tickVector;
|
||||
}
|
||||
|
||||
|
||||
@@ -647,10 +647,10 @@ namespace XCharts.Runtime
|
||||
var lineWidth = tooltip.lineStyle.GetWidth(theme.tooltip.lineWidth);
|
||||
var cenPos = m_Polar.context.center;
|
||||
var radius = m_Polar.context.outsideRadius;
|
||||
var sp = m_Polar.context.center;
|
||||
var tooltipAngle = m_AngleAxis.GetValueAngle(tooltip.context.angle);
|
||||
|
||||
var ep = ChartHelper.GetPos(sp, radius, tooltipAngle, true);
|
||||
var sp = ChartHelper.GetPos(m_Polar.context.center, m_Polar.context.insideRadius, tooltipAngle, true);
|
||||
var ep = ChartHelper.GetPos(m_Polar.context.center, m_Polar.context.outsideRadius, tooltipAngle, true);
|
||||
|
||||
switch (tooltip.type)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user