[Users] Ext.js Chart not displaying data from a shapefile...why???
Robert Buckley
robertdbuckley at yahoo.com
Tue Oct 26 17:44:25 CEST 2010
Hi...
With the following code I can display an ext.js chart. The y-axis is obviously
reading the store because the max value is correct. However no bars are shown.
Could anyone point out my error as to why the data isn´t displayed?
thanks,
Robert Buckley
//**************************************************
// the shapefile layer which contains the data
//**************************************************
var layer_wea = new OpenLayers.Layer.Vector("Windenergieanlagen", {
styleMap: new OpenLayers.StyleMap({
"default": new OpenLayers.Style(OpenLayers.Util.applyDefaults({
graphicName: "circle",
fillColor: "#FFD400",
strokeColor: "#55FF7F",
strokeWidth: 2,
graphicOpacity: 0.2,
graphicOpacity: 0.2,
pointRadius: 4
}, OpenLayers.Feature.Vector.style["default"])),
"select": new OpenLayers.Style(OpenLayers.Util.applyDefaults({
graphicName: "circle",
fillColor: "#55FF7F",
strokeColor: "red",
strokeWidth: 2,
graphicOpacity: 1,
pointRadius: 9
}, OpenLayers.Feature.Vector.style["select"]))
}),
strategies: [new OpenLayers.Strategy.Fixed()],
protocol: new OpenLayers.Protocol.WFS({
url: "/geoserver/ows",
version: "1.1.0",
featureType: "WEA_wgs84",
featureNS: "http://www.zgb.de/",
srsName: "EPSG:900913"
})
});
//**************************************************
// the store created from the shapefile layer
//**************************************************
var wea_store = new GeoExt.data.FeatureStore({
fields: [{
name: "Bez",
type: "string"
}, {
name: "Standort",
type: "string"
}, {
name: "Betreiber",
type: "string"
}, {
header: "mw_Inner",
type: "int",
width: 35
}],
layer: layer_wea
});
//*******************************************************************
//The chart which for some reason doesn´t display the data
//*******************************************************************
var wea_chart= new Ext.Panel({
height: 400,
renderTo: 'wea_chart',
title: 'Column Chart with Reload - Hits per Month',
forceFit: true,
items: {
xtype: 'columnchart',
store: wea_store,
yField: 'mw_Inner',
url: '../ext/resources/charts.swf',
xField: 'Standort',
xAxis: new Ext.chart.CategoryAxis({
title: 'Standort'
}),
yAxis: new Ext.chart.NumericAxis({
title: 'mw_inner'
}),
extraStyle: {
xAxis: {
labelRotation: -90
}
}
}
});
};
More information about the Users
mailing list