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

How to populate chart series with String values

$
0
0

I want to chart y-values as doubles with corresponding String x-values in an XY-Chart. I tried this and got an "Invalid data type" exception. I tried to switch chart type to bar and also received the same problem.

Is there a workaround in which I can use String values or am I stuck to numeric? Thanks for the help; please see code below.

For k = 0 To setList.Count – 1
                        If Not myConfig.OneSeries Then
                            series = chart.ChartGroups.Group0.ChartData.SeriesList.AddNewSeries()
                            series.Label = setList(k).Name
                            series.LineStyle.Pattern = C1.Win.C1Chart.LinePatternEnum.None
                            If Not myConfig.AllSets Then
                                series.SymbolStyle.Color = myConfig.Colors(k)
                            End If
                            series.SymbolStyle.Shape = C1.Win.C1Chart.SymbolShapeEnum.Circle
                            series.SymbolStyle.Size = (2 * (setList.Count – k) + 3)
                        End If
                        myTable = setList(k).Data
                        For l = 0 To myTable.Rows.Count – 1
                            series.X.Add(CDbl(myTable.Rows(l).Item(myX)))
                            series.Y.Add(CDbl(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>