This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var myDataSource = new YAHOO.util.DataSource( "[YOUR_DATA_URL]" ); | |
myDataSource.connMethodPost = true; | |
myDataSource.responseType = YAHOO.util.DataSource.TYPE_JSON; | |
myDataSource.responseSchema = | |
{ | |
resultsList: "sales", | |
fields: ["order_date","northamerican", "asian"] | |
}; | |
myDataSource.doBeforeParseData = function (oRequest, oFullResponse, oCallback) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
myDataSource.doBeforeParseData = function (oRequest, oFullResponse, oCallback) | |
{ | |
var i, results = oFullResponse.sales, | |
len = results.length, | |
filter, | |
hash = {}, | |
item, | |
parsedItem, | |
parsedItems = []; | |
for(i = 0; i < len; ++i) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var score_chart = new Y.Chart({ | |
dataProvider: scoreDataValues, | |
type: "bar", | |
render: "#chart", | |
styles: { | |
series: | |
{ | |
value: | |
{ | |
fill: { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var score_chart = new Y.Chart({ | |
dataProvider: scoreDataValues, | |
type: "bar", | |
render: "#chart", | |
seriesCollection: [ | |
{ | |
type: "bar", | |
keys: ["value"], | |
styles: { | |
fill: { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var selectedMarker; //reference to highlighted marker | |
outchart.subscribe("markerEvent:click", function(e) { | |
var series = e.series, //will need series to get markers array | |
index = e.index, //index of the marker in the series' marker array | |
markers = series.get("markers"), //array of marker for the series | |
marker = markers[index], //get the marker from the markers array | |
selectedSeriesIndex, //will be used to determine the series of the selectedMarker | |
selectedSeries, //series of the selectedMarker | |
color; //default color for the selectedMarker | |
if(selectedMarker) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
YUI().use('charts', function (Y) | |
{ | |
//dataProvider source | |
var myDataValues = [ | |
{date:"6/1/2008", miscellaneous:2000, expenses:3700, revenue:2200}, | |
{date:"8/1/2008", miscellaneous:5000, expenses:9100, revenue:100}, | |
{date:"10/1/2008", miscellaneous:4000, expenses:1900, revenue:1500}, | |
{date:"12/1/2008", miscellaneous:3000, expenses:3900, revenue:2800}, | |
{date:"2/1/2009", miscellaneous:500, expenses:7000, revenue:2650}, | |
{date:"4/1/2009", miscellaneous:3000, expenses:4700, revenue:1200}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dataProvider: scoreDataValues, | |
type: "bar", | |
render: "#water_score_chart", | |
stacked: true, | |
tooltip: scoreTooltip, | |
axes: { | |
values: { | |
keys: ["val"], | |
roundingMethod: 1000 | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var series = [ | |
{ | |
type: "stackedcolumn", | |
stacked: true, | |
yKey: "d1" | |
}, | |
{ | |
type: "stackedcolumn", | |
stacked: true, | |
yKey: "d2" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var pieGraph = new Y.Chart({ | |
render:"#mychart", | |
categoryKey:"Domain", | |
seriesKeys:["Hit"], | |
dataProvider:[], | |
type:"pie", | |
seriesCollection:[ | |
{ | |
categoryKey:"Domain", | |
valueKey:"Hit" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function addDividendMarker(time) | |
{ | |
var graph = mychart.get("graph"), | |
cb = graph.get("contentBox"), | |
axis = mychart.getAxisByKey("category"), | |
min = axis.get("minimum"), | |
max = axis.get("maximum"), | |
w = graph.get("width"), | |
h = graph.get("height"), | |
markerTime = time.valueOf(), |
OlderNewer