Infragistics Home

Infragistics Forums

Infragistics community online discussions.
Welcome to Infragistics Forums Sign in | FAQ
in Search

Determine Layer Axis when Data Clicked.

Last post 07-11-2008 6:07 by [Infragistics] Teodor Taushanov. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 07-02-2008 8:23

    • imm102
    • Not Ranked
    • Joined on 07-01-2008
    • Points 80

    Determine Layer Axis when Data Clicked.

    Hi,

    I have a multilayered Composite which displays multiple linecharts on a shared Xaxis with multiple Yaxis. I do not display any axis lables on the Y Axis as they would obviously overlap. What I would like to do is use the ChartDataClicked Event to display that particular layers axis labels. Does anyone know how to obtain the current axis from the eargs returned from an ChartDataClicked event.

    What I need is to find a ChartLayerAppearance class from the eargs so I can set the ItemFormatString.

    Code I have so far:

    this.ultraChart1.ChartDataClicked += ShowAxisLabels;

    .

    .

    private void ShowAxisLabels(object sender, ChartDataEventArgs eargs)

    {

    }

     

    Many Thanks,

    Filed under:
    • Post Points: 20
  • 07-03-2008 4:47 In reply to

    Re: Determine Layer Axis when Data Clicked.

    I'm not really sure what you want to do, but try looking at the following code:

    private void ultraChart1_ChartDataClicked(object sender, Infragistics.UltraChart.Shared.Events.ChartDataEventArgs eargs)

    {

    if (eargs.Primitive == null)

    {

    return;

    }

    Layer layer = eargs.Primitive.Layer as Layer;

    LineChartAppearance chartApp = layer.GetAppearance() as LineChartAppearance;

    }

    Best regards,
    Teodor Taushanov
    • Post Points: 20
  • 07-09-2008 7:43 In reply to

    • imm102
    • Not Ranked
    • Joined on 07-01-2008
    • Points 80

    Re: Determine Layer Axis when Data Clicked.

    Hi,

     Thanks for that, I can return a LineChartAppearance but what i would like is the ChartLayerAppearance for this layer and I can't figure out how to retreive it.

     At the moment my composite line chart has no Y axis labels. The senario I am after is that after a user clicks or hovers on a datapoint the labels will be displayed for that axis i.e. i need to be able to execute:

    layer.AxisY.Labels.ItemFormatString = "<DATA_VALUE:0.#>";

     If you can suggest a better way to do this, or some standard setting that im missing Id be most grateful. As it stands I either have the option of overlapping Y axis labels or none at all.

    Thanks,

    • Post Points: 20
  • 07-11-2008 6:07 In reply to

    Re: Determine Layer Axis when Data Clicked.

    In this case you can try:

    private void ultraChart1_ChartDataClicked(object sender, Infragistics.UltraChart.Shared.Events.ChartDataEventArgs eargs)

    {

    if (eargs.Primitive == null)

    {

    return;

    }

    Layer layer = eargs.Primitive.Layer as Layer;

     

    foreach (ChartLayerAppearance chartLayerApp in this.ultraChart1.CompositeChart.ChartLayers)

    {

    if (chartLayerApp.Key == layer.LayerID)

    {

    chartLayerApp.AxisY.Labels.ItemFormatString =
    "<DATA_VALUE:0.#>";

    }

    }

    }

    Best regards,
    Teodor Taushanov
    • Post Points: 5
Page 1 of 1 (4 items)
Powered by Community Server (Commercial Edition), by Telligent Systems