1
votes

I'm using a line chart to plot some values, where the x-axis has a set of strings and the y-axis has a double value between 0 and 1. Everything works correctly except there is a gap between the first x value and the y-axis the image shows.

In this question the solution is setting the x-axis maximum and minimum value. However, I can't seem to do it in this case as the values are strings and not doubles / dates.

2

2 Answers

0
votes

Given that you are using strings, this may or may not help. Try setting the IsXValueIndexed property of your underlying series to be false.

See this MSDN article for reference: http://msdn.microsoft.com/en-us/library/system.web.ui.datavisualization.charting.series.isxvalueindexed(v=vs.110).aspx

0
votes

To remove the margin you need to set

chart.ChartAreas[0].AxisX.IsMarginVisible = false;