# Converting Data Points into Pixel Coordinates

## Content



The two methods that convert either data coordinates or data indices into pixel coordinates are the **DataIndexToCoord** and **DataCoordToCoord** methods of the ChartGroup object. The [DataIndexToCoord](/componentone/api/win/online-chart2d/dotnet-framework-api/C1.Win.C1Chart.4.8/C1.Win.C1Chart.ChartGroup.DataIndexToCoord.html) method takes a series and point index and returns the client coordinates of the specified data point. The DataCoordToCoord method takes a set of data coordinates and returns a pixel coordinate. These methods are quite similar to the other conversion methods.

### DataIndexToCoord Method

The DataIndexToCoord method takes four parameters, and returns a pixel coordinate as seen in the following example:

DOC-DETAILS-TAG-OPEN

DOC-SUMMARY-TAG-OPEN

To write code in Visual Basic

DOC-SUMMARY-TAG-CLOSE

```vbnet
Dim CoordX, CoordY As Integer     
C1Chart1.ChartGroups.Group0.
  DataIndexToCoord(ChartSeries, ChartPoint, CoordX, CoordY)    
Debug.WriteLine("X Chart Coordinate: " & CoordX.ToString())    
Debug.WriteLine("Y Chart Coordinate: " & CoordY.ToString())
```

DOC-DETAILS-TAG-CLOSE

DOC-DETAILS-TAG-OPEN

DOC-SUMMARY-TAG-OPEN

To write code in C#

DOC-SUMMARY-TAG-CLOSE

```csharp
int CoordX=0, CoordY=0;    
c1Chart1.ChartGroups.Group0.
   DataIndexToCoord(ChartSeries, ChartPoint, ref CoordX, ref CoordY);  
Debug.Writeline("X Chart Coordinate: " + CoordX.ToString());   
Debug.Writeline("Y Chart Coordinate: " + CoordY.ToString());
```

DOC-DETAILS-TAG-CLOSE

### DataCoordToCoord Method

The [DataCoordToCoord](/componentone/api/win/online-chart2d/dotnet-framework-api/C1.Win.C1Chart.4.8/C1.Win.C1Chart.ChartGroup.DataCoordToCoord.html) method takes four parameters, and returns a pixel coordinate as seen in the following example:

DOC-DETAILS-TAG-OPEN

DOC-SUMMARY-TAG-OPEN

To write code in Visual Basic

DOC-SUMMARY-TAG-CLOSE

```vbnet
Dim CoordX, CoordY As Integer       
C1Chart1.ChartGroups.Group0._   
   DataCoordToCoord(DataCordX, DataCoordY, CoordX, CoordY)    
Debug.WriteLine("X Chart Coordinate: " & CoordX.ToString())   
Debug.WriteLine("Y Chart Coordinate: " & CoordY.ToString())
```

DOC-DETAILS-TAG-CLOSE

DOC-DETAILS-TAG-OPEN

DOC-SUMMARY-TAG-OPEN

To write code in C#

DOC-SUMMARY-TAG-CLOSE

```csharp
int CoordX=0, CoordY=0;      
c1Chart1.ChartGroups.Group0.  
   DataCoordToCoord(DataCordX, DataCoordY, ref CoordX, ref CoordY);    
ConsoleDebug.Writeline("X Chart Coordinate: " + CoordX.ToString());    
ConsoleDebug.Writeline("Y Chart Coordinate: " + CoordY.ToString());
```

DOC-DETAILS-TAG-CLOSE


> type=note
> **Note**: For a complete sample using the DataCoordToCoord method, see the PropGrid or the explorer samples located [here](https://developer.mescius.com/samples).

## See Also

[Rotating, Scaling, Translating, and Zooming](/componentone/docs/win/online-chart2d/enduserinteraction/rotatingscalingtrans)