WPF live charts x axis labels are coming twice though set only once

Viewed 154

I m facing a issue in viewing the label list properly in x-axis while using livecharts in wpf. The label list is proper, and before setting I clear the axis too.

The code used is:

EMT_Chart.AxisX.Clear();

int stepSize = 1;

Axis xAxis = new Axis()
{
    FontSize = 12,
    Separator = new LiveCharts.Wpf.Separator { Step = stepSize, IsEnabled = false },
    ShowLabels = true,
    Labels = labelList,
    LabelsRotation = -90.0
};
EMT_Chart.AxisX.Add(xAxis);

And xaml is as below:

<lvc:CartesianChart x:Name="EMT_Chart" 
                    Series="{Binding Series}" 
                    LegendLocation="Bottom" 
                    Zoom="XY" Pan="XY"/>

Basically on zooming out, the x-axis labels are coming in a cyclic fashion which isnt intended. And on zoominf in the value and label alignment gets messed up.

Please suggest.

This is the plot without zoom or pan

enter image description here

On zooming out the plot x-axis labels and the plot too doesn't look proper

enter image description here

On zooming in the plot x-axis labels and the values are not aligned

enter image description here

0 Answers
Related