cancel
Showing results for 
Search instead for 
Did you mean: 

How to capture X-axis value of iChart to display correspoding Grid Chart

Former Member
0 Kudos

Hi Everybody,

I have an iChart of type Bar, which is displaying OrderNumber on x-axis and corresponding values on y-axis. Now when I click on one particular Bar it should capture the corresponding x-axis value(OrderNumber) and open a grid chart showing values of that OrderNumber.

I used "ChartDoubleClickEvent", and when doubleclicked it calls javascript function having document.iChart.getChartObject().getAxisLabelColumns();

But this getAxisLabelColumns() gets only the name of the x-axis i.e., OrderNumber but not the OrderNumber's value of the selected bar.

Kindly respond asap.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Srinivas

<b>Scenario:</b> You have a Bar Chart which contains 4 bars each containing ordernumber at X axis & ordernumber's value at Y axis. You want to show (get) the values on the Y axis after clicking on the Chart

<b>Solution:</b> You hv to use the method

<b><i>document.iChart.getChartObject().getYDataValueAt(1,1))</i></b> for first bar's value

<b><i>document.iChart.getChartObject().getYDataValueAt(2,1))</i></b> for 2nd bar's value and so on.

Regards

Som

Former Member
0 Kudos

Hi Som,

Thanks for the reply, but I think you have misunderstood the scenario, what I want is the actual order number itself, so that I can pass this OrderNumber to shoot a query and openup a Grid chart displaying OrderNumber, it's Value and other attributes found in the table.

So its like, When I click on a datapoint of a SPC chart or a bar of an iChart it should capture the value on x-axis on runtime and pass it to the querytemplate.

Hope I am clear enough with the question.

Former Member
0 Kudos

Search the forum & the help docs for getLastSelectedTag().

Former Member
0 Kudos

Srinivas

Good one. Better use the Display Template with type <i>iSPCChart</i> for ur purpose where in the SPC Chart, each DataPoint will contain all desired attributes including OrderNumber [Use <b>Attribute Columns Field in Data Mapping Tab</b> for those attribute names]

Say in the Attribute Columns u have the attributes in this order:

1. Attribute1

2. Value

<b><i>3. OrderNumber</i></b>

4. Attribute2

5. Attribute3

Then use following javascript codes

function getOrderNumber()

{

<b>

var SelectedPoint = = document.MyApplet.getChartObject().getUpperSelectedPoint();

var OrderNo = document.MyApplet.getChartObject().getUpperAttributeValueAt(SelectedDataPoint,3);

</b>

<i>

//Use this OrderNo to be passed to the Query u hv.

</i>

}

APPLET Tags

<APPLET NAME="MyApplet" id="scanlog" WIDTH="700" HEIGHT="400" CODE="iSPCChart"

CODEBASE="/Illuminator/Classes" ARCHIVE="illum8.zip" MAYSCRIPT>

<PARAM NAME="QueryTemplate" VALUE="UserTemplates/PoC/Som/XAGetCharValue">

<PARAM NAME="DisplayTemplate" VALUE="UserTemplates/PoC/Som/PlantSPCDetailChart">

<b><i><PARAM NAME="UpperChartSelectionEvent" VALUE="getOrderNumber"></i></b>

</APPLET>

Do inform if this works for ur requirement or not

Regards

Som

jcgood25
Active Contributor
0 Kudos

Srini,

There is no need to make your applet an SPC chart unless you really need the statistical features, especially when the iChart does what you need.

I think this thread should help:

Map your OrderNumber into the Datalink Columns (just like you've done for the X Axis) and you will be able to reference this point specific value through javascript like you want for your drill down. If you've enabled mouse tracking in the chart you will also see this order value at the top left inside [] brackets.

Regards,

Jeremy

Former Member
0 Kudos

Yes Som, That did work in iSPC chart but with a little bit of correction it is (SelectedPoint, <b>1</b>) and not (SelectedDataPoint,3) anyway What I wanted was the object methods getUpperSelectedPoint() and getUpperAttributeValueAt() which I got it from you.

Thank you very much.

Former Member
0 Kudos

Thanks for that info Jeremy, I got the solution.

Srinivas Kumar

Answers (0)