[CLOSED] id chart object

  1. #1

    [CLOSED] id chart object

    Hi,

    I set my code as below

        var onMouseUp = function (item) {
           var series = App.chartAnalysis.series.get(0),
                index = Ext.Array.indexOf(series.items, item);
                selectedStoreItem = item.storeItem;
            App.direct.OnItemMouseUp(selectedStoreItem.get('partNumber'),index);
        };
    Into the method OnItemMouseUp I create the new chart. when I click on the chart created dinamically this function generate the new one.
    I need to know the id the chart object then I want that the "chartAnalysis" in following string "App.chartAnalysis.series.get(0)"
    becomes variable.

    How can do for this issue?

    Which are the parameters for this function? only "item" ?

    Thank you so much.
    Last edited by Daniil; Oct 18, 2012 at 6:32 PM. Reason: [CLOSED]
  2. #2
    Hi @tactime10,

    Yes, there is but "item" argument. You can get a chart id this way:
    item.series.chart.id
    Also you can use a scope that refers to a series instance.
    this.chart.id
  3. #3
    I replaced the following string
    var series = App.chartAnalysis.series.get(0),
    with this
           var chartElement = this.chart.id;
           var series = chartElement.series.get(0),
    into the function below
    var onMouseUp = function (item) {
           var chartElement = this.chart.id;
           var series = chartElement.series.get(0),
            index = Ext.Array.indexOf(series.items, item);
            selectedStoreItem = item.storeItem;
        App.direct.OnItemMouseUp(selectedStoreItem.get('partNumber'),index);
    };
    but now the click on the column it doesn't work, I think there is an error in this changement.
    Can you suggest me any things?

    Thank you so much for your patience.
  4. #4
    Well, I think you can use just
    var series = this;
    or
    var series = item;
  5. #5
    ok,

    with the "var series = this" the function work, instead with the last string that you suggest it doesn't work

    Thanks.
  6. #6
    My fault. This should work.
    var series = item.series;
  7. #7
    ok,

    also in this way the function work.

    Thanks.

Similar Threads

  1. [CLOSED] How can get chart object from codebehind
    By tactime10 in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: Oct 15, 2012, 5:07 PM
  2. Replies: 2
    Last Post: Aug 13, 2012, 2:12 PM
  3. Replies: 1
    Last Post: Jun 02, 2012, 7:12 AM
  4. Replies: 0
    Last Post: Oct 21, 2011, 3:04 AM
  5. Replies: 1
    Last Post: Sep 13, 2011, 5:19 PM

Posting Permissions