I'm trying to do something that I believe should be easy. I want to show the values 1 through 30, evenly spaced, because I do a run of data that represents 30 minutes of data. Sometimes there are 500 data points, but sometimes there are thousands (I can easily determine the number of points though).
Basically, my code for the Xaxis looks like this, but it is not doing what I want. Below the code is a screenshot of what is happening, and below that is a screenshot of what I want.
cartChart.AxisX.Add(new Axis
{
// TODO fix this to acutally show real time
Title = "Minutes",
//Labels= { "1", "2", "4", "6", "8", "10", "12", "14", "16", "18", "20", "22", "24", "26", "28", "30" },
Separator = new LiveCharts.Wpf.Separator
{
Step = listOfChartValues[i].Count / 30 > 0 ? listOfChartValues[i].Count / 30 : 1, // this is making the assumtion that data arrivals follow uniform distribution
IsEnabled = false
}
});
Current Bug chart (trying to put a minute label for every data point)
Need only 30 minute labels (maybe my algorithm to calculate step needs adjusting, currently I divide total number of data points by 30)
I looked at these two posts, but this is a different issue
LiveChart doesn't show all Labels on x-axis WPF