2D Chart for WinForms | ComponentOne
End-User Interaction / Coordinate Conversion Methods / Converting Coordinates to Series
In This Topic
    Converting Coordinates to Series
    In This Topic

    In the C1Chart Legend, series are represented by the series name and a symbol containing a sample of the SymbolStyle or LineStyle. The SeriesFromCoord method of the Legend returns the nearest associated series from a pixel coordinate value located in the legend. For instance, suppose that the user clicks on the symbol for the first series in the Legend, the pixel coordinates of the user's mouse at this moment when input into the SeriesFromCoord method would return group and series values from the Group and Series parameters. The following is an example of this:

    To write code in Visual Basic

    Visual Basic
    Copy Code
    Dim LegendGroup As Integer      
    Dim LegendSeries As Integer 
    C1Chart1.Legend.SeriesFromCoord(170, 275, LegendGroup, LegendSeries)
    

    To write code in C#

    C#
    Copy Code
    int LegendGroup = 0;   
    int LegendSeries = 0;      
    c1Chart1.Legend.SeriesFromCoord(170, 275, ref LegendGroup, ref LegendSeries);
    
    Note: For a complete sample using this method, see DataStyl or PieStuff sample located here.
    See Also