You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My data columns does not align center of my XAxis. How do I fix this issue?
public ISeries[] Series { get; set; } =
{
new ColumnSeries<DateTimePoint>
{
Name = "Bar 1",
Values = new ObservableCollection<DateTimePoint>
{
new DateTimePoint(new DateTime(2026, 3, 1), 3),
new DateTimePoint(new DateTime(2026, 4, 1), 6),
new DateTimePoint(new DateTime(2026, 5, 1), 20),
}
},
new ColumnSeries<DateTimePoint>
{ Name = "Bar 2",
Values = new ObservableCollection<DateTimePoint>
{
new DateTimePoint(new DateTime(2026, 3, 1), 3),
new DateTimePoint(new DateTime(2026, 4, 1), 6),
new DateTimePoint(new DateTime(2026, 5, 1), 20),
}
},
new ColumnSeries<DateTimePoint>
{ Name = "Bar 3",
Values = new ObservableCollection<DateTimePoint>
{
new DateTimePoint(new DateTime(2026, 3, 1), 3),
new DateTimePoint(new DateTime(2026, 4, 1), 6),
new DateTimePoint(new DateTime(2026, 5, 1), 20),
}
},
};
// You can use the DateTimeAxis class to define a date time based axis
// The first parameter is the time between each point, in this case 1 day
// you can also use 1 year, 1 month, 1 hour, 1 minute, 1 second, 1 millisecond, etc
// The second parameter is a function that receives the value and returns the label
public Axis[] XAxes { get; set; } =
{
new DateTimeAxis(TimeSpan.FromDays(30), date => date.ToString("MMMM"))
{
LabelsRotation = 15,
SubseparatorsCount = 1,
SeparatorsPaint = new SolidColorPaint
{
Color = s_gray,
StrokeThickness = 1,
PathEffect = new DashEffect(new float[] { 3, 3 })
},
SubseparatorsPaint = new SolidColorPaint
{
Color = s_gray2,
StrokeThickness = 0.5f
},
ZeroPaint = new SolidColorPaint
{
Color = s_gray1,
StrokeThickness = 2
},
TicksPaint = new SolidColorPaint
{
Color = s_gray,
StrokeThickness = 1.5f
},
SubticksPaint = new SolidColorPaint
{
Color = s_gray,
StrokeThickness = 1
}
}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
My data columns does not align center of my XAxis. How do I fix this issue?
Beta Was this translation helpful? Give feedback.
All reactions