Hello!
I made a line graph that is giving me the following output:
Below is the basic code:
chartProcessStats1.ChartType = Infragistics.UltraChart.Shared.Styles.ChartType.LineChart 'chartProcessStats1.ChartType = Infragistics.UltraChart.Shared.Styles.ChartType.ScatterLineChart
Dim temparrayx() As Decimal = New Decimal() {-10, 10, 100, 110, 120} Dim temparrayy() As Decimal = New Decimal() {0.5, 3, 2, 3, 1}
Dim graphval As New NumericSeries()
Dim k As Integer = 0
chartProcessStats1.LineChart.ChartComponent.Series.Clear()
While (k < temperaturearray.Length)
graphval.Points.Add(New NumericDataPoint(temparrayy(k), temparrayx(k), False))
k = k + 1 End While
chartProcessStats1.LineChart.ChartComponent.Series.Add(graphval)
temperaturearray = {} errorarray = {}
It appears the output is a result of the x axis being entered as a string rather than a decimal (despite the fact the actual array is made up of decimal values). Is there a way to enter the x axis as decimals (so the graph scales properly)?
Thanks in advance!
Actually, if there's a way to change the range of the y axis as well (I want to change it to 0 to 3, for instance), that would be helpful to know as well. I've tried sorting through the pages on the site and I haven't been able to find the property I need to set. Thanks!
Hello Jeremy,
The LineChart will populate the series’ Y values with one row’s data found in each numeric column, and populate the X values according to the string keys of the columns themselves. It knows the x values only by the string keys, so this doesn’t provide the functionality of the chart understanding your x values that you want.
The Scatter Chart will populate the series using 2 numeric columns, and you will specify the X and Y columns via the UltraChart.ScatterChart.ColumnX and UltraChart.ScatterChart.ColumnY properties. For more information on this, please visit: http://help.infragistics.com/doc/WinForms?page=Chart_Working_with_Scatter_Chart_Data.html
This will allow the chart to understand your X values and, among other things, space out your points along the X axis according to their value. I’ve attached a sample project which should show you how you can create a ScatterChart with this ability.
Concerning changing the range of the axis, you’ll need to set the Axis’ RangeType to Custom to see your RangeMin and RangeMax settings appear.
Please let me know if there’s anything further I can help you with.