-
Notifications
You must be signed in to change notification settings - Fork 507
Open
Description
Hi, the series have wrong colors:

I've modified the DrawSeries in (UIBarChart.cs) method as follow:
protected virtual void DrawSeries(Graphics g, List<UIBarSeries> series)
{
if (series == null || series.Count == 0) return;
using var TempFont = Font.DPIScaleFont(UIStyles.DefaultSubFontSize);
for (int i = 0; i < Bars.Count; i++)
{
var bars = Bars[i];
foreach (var info in bars)
{
Color color = ChartStyle.GetColor(i);
g.FillRectangle(color, info.Rect);
if (Option.ShowValue)
{
string value = info.Value.ToString("F" + info.Series.DecimalPlaces);
if (info.Top)
{
g.DrawString(value, TempFont, color, new Rectangle((int)info.Rect.Center().X - Width, (int)info.Rect.Top - Height, Width * 2, Height), ContentAlignment.BottomCenter);
}
else
{
g.DrawString(value, TempFont, color, new Rectangle((int)info.Rect.Center().X - Width, (int)info.Rect.Bottom, Width * 2, Height), ContentAlignment.TopCenter);
}
}
}
}
for (int i = 0; i < Option.XAxis.Data.Count; i++)
{
Bars[0][i].Size = TextRenderer.MeasureText(Bars[0][i].Tips, TempFont);
}
}
Regards,
Angelo
Metadata
Metadata
Assignees
Labels
No labels
