| Page 1 of 1 | [ 1 post ] |
|
I have 3 charts in a TabView, each chart in it's own tab. The charts uses 3 datasources to get data from the server. When the page is loaded all 3 charts are created and 3 calls are made to the server. This is just perfect and what I need.
The problem is when I click on a tab, then two calls are made to the server. One call for the chart that is currently shown and one for the chart that is going to be shown. So if I'm on tab 1 and press tab 2. Then call is made for chart 1 and chart 2. I don't understand why this is happening?? I'm using yui 2.8.1 Here are some of the code: Code: var tabView = new YAHOO.widget.TabView("chartsTabs"); Code: yEvent.onContentReady("chart2", function(){ var ds = new YAHOO.util.DataSource("JSON_GetTopListErrorMetrics?Openagent&Type=ErrorLifeCycle"); ds.connMethodPost = true; ds.responseType = YAHOO.util.DataSource.TYPE_JSON; ds.responseSchema = { resultsList: "Result", fields: ["Month", "MP", "MS", "WP"] }; var yAxis = new YAHOO.widget.NumericAxis(); yAxis.minimum = 0; yAxis.title = "Days"; var xAxis = new YAHOO.widget.CategoryAxis(); xAxis.title = "Month"; var chart = new YAHOO.widget.ColumnChart( "chart2", ds, { xField: "Month", series: [ {displayName: "MP", yField: "MP", style: {color: "#FF0000"}}, {displayName: "MS", yField: "MS", style: {color: "#00FF00"}}, {displayName: "WP", yField: "WP", style: {color: "#0000FF"}}, ], yAxis: yAxis, xAxis: xAxis, dataTipFunction: function(item, index, series){ return series.displayName + " for " + item.Month + "\n" + item[series.yField] + " days" }, style: { ... } }); }); /Casper |
| Page 1 of 1 | [ 1 post ] |
| You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum |
© 2006-2013 Yahoo! Inc. All rights reserved.
All code on this site is licensed under the BSD License unless stated otherwise.
About This Site · Security Contact Info
Powered by phpBB® Forum Software © phpBB Group