Skip to main content

ChartClientSideEvents.ObjectSelected Property

Gets or sets the name of the JavaScript function or the entire code which will handle a client chart control’s ASPxClientWebChartControl.ObjectSelected event.

Namespace: DevExpress.XtraCharts.Web

Assembly: DevExpress.XtraCharts.v24.1.Web.dll

NuGet Package: DevExpress.Web.Visualization

Declaration

[DefaultValue("")]
public string ObjectSelected { get; set; }

Property Value

Type Default Description
String String.Empty

A string that represents either the name of a JavaScript function or the entire JavaScript function code used to handle an event.

Remarks

See Handling Client-side Scripts for more information.

Example

The following example demonstrates how to show a message with information about a selected pie slice.

<script type="text/javascript">
    function onObjectSelected(s,e) {
        if (e.hitInfo.inSeriesPoint) {
            alert(e.hitInfo.seriesPoint.argument + "(" + e.hitInfo.seriesPoint.values[0] + "M km²)");
        }
    }
</script>

<!--...-->
<dx:WebChartControl ID="WebChartControl1" runat="server" 
                    Height="500px" Width="500px">
    <Legend Name="Default Legend"></Legend>
    <SeriesSerializable>
        <dx:Series Name="Series 1">
            <points>
                <dx:SeriesPoint ArgumentSerializable="Russia" SeriesPointID="0" Values="17.0752"></dx:SeriesPoint>
                <dx:SeriesPoint ArgumentSerializable="Canada" SeriesPointID="1" Values="9.98467"></dx:SeriesPoint>
                <dx:SeriesPoint ArgumentSerializable="USA" SeriesPointID="2" Values="9.63142"></dx:SeriesPoint>
                <dx:SeriesPoint ArgumentSerializable="China" SeriesPointID="3" Values="9.59696"></dx:SeriesPoint>
                <dx:SeriesPoint ArgumentSerializable="Brazil" SeriesPointID="4" Values="8.511965"></dx:SeriesPoint>
                <dx:SeriesPoint ArgumentSerializable="Australia" SeriesPointID="5" Values="7.68685"></dx:SeriesPoint>
                <dx:SeriesPoint ArgumentSerializable="India" SeriesPointID="6" Values="3.28759"></dx:SeriesPoint>
                <dx:SeriesPoint ArgumentSerializable="Others" ColorSerializable="#FBD5B5" SeriesPointID="7" Values="81.2">
                </dx:SeriesPoint>
            </points>
            <viewserializable>
                <dx:PieSeriesView>
                </dx:PieSeriesView>
            </viewserializable>
        </dx:Series>
    </SeriesSerializable>
    <ClientSideEvents ObjectSelected="onObjectSelected"/>
</dx:WebChartControl>
See Also