I am looking to create a vertical section in a livechart. I have found examples of this but the code used is now depreciated.
This was my starting point: Found picture
var axisSection = new AxisSection
{
FromValue = index,
ToolTip = "dfsdf",
ToValue = index,
Stroke = Brushes.YellowGreen,
StrokeThickness = 1,
StrokeDashArray = new DoubleCollection(new[] { 4d })
};
chart.VisualElements.Add(new VisualElement
{
HorizontalAlignment = HorizontalAlignment.Center,
VerticalAlignment = VerticalAlignment.Top,
UIElement = new TextBlock //notice this property must be a wpf control
{
Text = journalObj.Title,
FontWeight = FontWeights.Bold,
Foreground = Brushes.Snow,
FontSize = 12,
Opacity = 0.6
}
});
However I found that "FromValue" has changed to "Value" and "ToValue" has changed to "SectionWidth" and the section created is now horizontal instead of vertical. My code is in vb.net (as that is what I am developing in) but here is a sample:
Dim axissection As New impLiveChartsWPF.AxisSection
With axissection
.Value = 1
.SectionWidth = 1
.Stroke = Brushes.YellowGreen
.StrokeThickness = 1
.StrokeDashArray = collection
End With
And this code creates a horizontal box that goes from 1 to 2 on the y axis. need a thin vertical line on the x axis to denote a change in parameters (like a system turning off or on).