simplechart.js revision 4ea8aca4200c515337ce5b76a879cea312a18851
/**
* Create data visualizations with line graphs, histograms, and other methods.
* @module chart
*
* Note: SimpleChart is a temporary class that has been created for the purposes of observing and testing the current state of the underlying flash chart rendering engine. This file
* will be replaced in future iterations and its api will vary significantly.
*/
/**
* SimpleChart creates a basic line chart. SimpleChart uses the existing chart classes to allow for easy creation of a chart.
* @module chart
* @title SimpleChart
* @namespace YAHOO.widget
*/
/**
* Creates the Chart instance that includes an x-axis, y-axis and graph.
*
* @class SimpleChart
* @extends Y.Event.Target
* @constructor
* @param {String|HTMLElement} id The id of the element, or the element itself that the Chart will be placed into.
* The width and height of the Chart will be set to the width and height of this container element.
* @param {String} charttype The type of chart to render. Defaults to "line".
* @param {Object} optional hash of properties and styles.
*/
{
if(charttype)
{
}
this._parseConfig(config);
this.xaxis = new Y.Axis({parent:this.app, axisType:this._xAxisProps.type, styles:this._xaxisstyles});
this.yaxis = new Y.Axis({parent:this.app, axisType:this._yAxisProps.type, styles:this._yaxisstyles});
this.data = {};
this.graph = null;
}
{
/**
* Graph type
*/
_type:"line",
/**
* Axis type for x axis
*/
type:"Category",
key:"item"
},
/**
* Axis type for y axis
*/
type:"Numeric",
key:"value"
},
{
var chart = this.chart, app = this.app, xaxis = this.xaxis, yaxis = this.yaxis, graph = this.graph, styles = this._graphstyles;
if (this._type == "line")
{
graph = new Y.Graph({parent:chart, seriesCollection:[{type:this._type, xAxisData:xaxis, yAxisData:yaxis, xKey:xkey, yKey:ykey, styles:styles}]});
}
},
padding:{
}
},
fillColor:0xDEE2FF,
borderColor:0xDEE2FF
}
},
label:{
fontName:"Georgia",
fontSize:12,
color:0x000000,
}
},
label:{
fontName:"Georgia",
fontSize:12,
color:0x000000,
}
},
color:0x000000,
alpha:1,
weight:"2",
marker:{
fillColor:0x000000
}
},
_parseConfig: function(config)
{
if(config)
{
{
}
{
{
}
{
}
}
{
{
}
{
}
}
{
}
{
}
{
}
{
{
}
{
}
{
}
{
}
{
}
}
}
else
{
{
}
{
}
}
},
_chartConfig:{},
{
var i;
if(!defaultStyles)
{
return configStyles;
}
for(i in configStyles)
{
if(configStyles.hasOwnProperty(i))
{
{
}
else
{
defaultStyles[i] = configStyles[i];
}
}
}
return defaultStyles;
}
});
Y.SimpleChart = SimpleChart;