# Displaying String Values as Annotations

## Content



At times, it is very convenient to use string values as annotations along the X or Y axes, and numeric values along the other axis.

For example, suppose a data source contains 2 columns, one with a company name (string), and one with the number of ComponentOne products purchased by that company. To create a bar chart summarizing this data, one might create a series that uses the number of products on the Y axis, and then create an array with counting numbers and use this array for the X values. Then, create ValueLabels for the X axis, pairing each company name with a count number, thus producing a chart similar to the following:

![](https://cdn.mescius.io/document-site-files/images/70bd33a2-280e-4cc3-a1c0-7b827eceb8aa/imagesext/image9_146.png)

Since this situation occurs often, [C1Chart](/componentone/api/win/online-chart2d/dotnet-framework-api/C1.Win.C1Chart.4.8/C1.Win.C1Chart.C1Chart.html) accepts ChartDataArray with strings, which automatically enumerates the array values and creates [ValueLabels](/componentone/api/win/online-chart2d/dotnet-framework-api/C1.Win.C1Chart.4.8/C1.Win.C1Chart.Axis.ValueLabels.html) for the appropriate axis. Using this behavior, it is possible (and very convenient) to set the [DataField](/componentone/api/win/online-chart2d/dotnet-framework-api/C1.Win.C1Chart.4.8/C1.Win.C1Chart.ChartDataArray.DataField.html) properties for a [ChartDataSeries](/componentone/api/win/online-chart2d/dotnet-framework-api/C1.Win.C1Chart.4.8/C1.Win.C1Chart.ChartDataSeries.html) to the string values directly and get the same results:

DOC-DETAILS-TAG-OPEN

DOC-SUMMARY-TAG-OPEN

To write code in Visual Basic

DOC-SUMMARY-TAG-CLOSE

```vbnet
C1Chart1.ChartGroups(0).ChartData.SeriesList(0).X.DataField = "CompanyNames"
C1Chart1.ChartGroups(0).ChartData.SeriesList(0).Y.DataField = "UnitsPurchased"
```

DOC-DETAILS-TAG-CLOSE

DOC-DETAILS-TAG-OPEN

DOC-SUMMARY-TAG-OPEN

To write code in C#

DOC-SUMMARY-TAG-CLOSE

```csharp
c1Chart1.ChartGroups[0].ChartData.SeriesList[0].X.DataField = "CompanyNames";
c1Chart1.ChartGroups[0].ChartData.SeriesList[0].Y.DataField = "UnitsPurchased";
```

DOC-DETAILS-TAG-CLOSE

## See Also

[Mixing ChartDataArray Inputs](/componentone/docs/win/online-chart2d/chartingdata/enteringandmodifying/mixingchartdataarray)