-
10 Jan 2013 3:42 PM #1
[Ext: 4.2.0 Beta2] - Creating a chart without a series
[Ext: 4.2.0 Beta2] - Creating a chart without a series
Hello,
I'm just attempting to move to 4.2 from 4.1.1 and I'm having some issues with how I've been creating charts. I have a generic chart definition (line chart for example) that includes a chart skeleton but no series like so:
I would then create the chart:Code:Ext.define('MyApp.view.chart.charts.LineChart', { extend: 'Ext.container.Container', alias: 'widget.linechart', uses: [ 'Ext.data.JsonStore', 'Ext.chart.*', 'Ext.fx.target.Sprite', 'Ext.layout.container.Fit' ], border: false, initComponent: function () { Ext.apply(this, { layout: 'fit', items: { xtype: 'chart', animate: false, store: 'ChartStore', border: false, insetPadding: 20, height: 375, legend: { position: 'bottom' }, axes: [{ type: 'Numeric', position: 'left', fields: [], minorTickSteps: 1 }, { type: 'Category', position: 'bottom', fields: ['DisplayText'], label: { rotate: { degrees: 270 } } }] } }); this.callParent(arguments); } });
However at this point I'm getting an error thrown:Code:var myChart = Ext.create('MyApp.view.chart.charts.LineChart');
I'm assuming it's no longer possible to create a chart without a series? Previously I would do the above and then iterate through the store adding any records in the store for a series, this way I wouldn't have to declare what items would be in the series since it would vary:Code:TypeError: series[0] is undefined
ThanksCode:Ext.iterate(record, function (key, value) { chart.series.add({ type: 'line', axis: 'left', smooth: true, xField: 'DisplayText', yField: key, title: key}); });
-
14 Jan 2013 2:36 PM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,714
- Vote Rating
- 436
Sounds like a bug was introduced. Normally you should specify the series but not all use cases want this to be.
I have opened a bug in our bug tracker.
-
14 Jan 2013 2:44 PM #3
You found a bug! We've classified it as
EXTJSIV-8233
.
We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.


Reply With Quote