Quantcast
Channel: Our ComponentOne » All Posts
Viewing all articles
Browse latest Browse all 14170

How to create a chart using a series with String values.

$
0
0

I want to plot y-values associated with String IDs using an XY-chart. When I initially tried this, I received an "Invalid data type" exception. I assumed this was due to the continuous number line on the x-axis, so I tried switching to a bar graph, which maps in discrete segments, but I received the same error.

Is this just impossible or is there some sort of workaround? Please see VB code below. myTable is a DataTable.

                    For k = 0 To myConfig.SetList.Count – 1
                        If Not myConfig.OneSeries Then
                            series = chart.ChartGroups.Group0.ChartData.SeriesList.AddNewSeries()
                            series.LineStyle.Pattern = C1.Win.C1Chart.LinePatternEnum.None
                            series.SymbolStyle.Color = myConfig.Colors(k)
                            series.SymbolStyle.Shape = C1.Win.C1Chart.SymbolShapeEnum.Circle
                            series.SymbolStyle.Size = (3 * (myConfig.SetList.Count – k) + 1)
                        End If
                        myTable = myConfig.SetList(k).Data
                        For l = 0 To myTable.Rows.Count – 1
                            series.X.Add(myTable.Rows(l).Item(myX))
                            series.Y.Add(myTable.Rows(l).Item(myY))
                        Next
                    Next

Viewing all articles
Browse latest Browse all 14170

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>