0

I'm stuck on a problem where i need to set y-axis based on its plot. Right now program stretches the plot to fit whole chart however i need it to let some free space above the plot. I wasn't able to come up with anything so far. Code looks like this:

Chart chart = new Chart()
{
    LegendVisibility = Visibility.Hidden,
    LeftTitle = YaxisName[i],
    BottomTitle = "Carrier i [-]",                      
};
chart.Content = getChart(graphIndex, GraphYvalues, GraphXvalues, GraphListOfNames[graphIndex]);
chartView.Children.Add(chart);

Could someone please help me out? Thank you

David Hala
  • 13
  • 4

1 Answers1

1

Eventually I was able to scramble something up. It's actually so damn easy. I gave up on setting the range of y-axis and instead of that I added padding to the plot itself like this:

LineGraph lineGraphFar = new LineGraph()
{
    Stroke = new SolidColorBrush(Colors.Red),
    Padding = new System.Windows.Thickness(0, 30, 0, 0)
};

It's surely not the greatest option but it will do the job.

ouflak
  • 2,458
  • 10
  • 44
  • 49
David Hala
  • 13
  • 4