Note that there are some explanatory texts on larger screens.

plurals
  1. POext js 4 column chart bug? series remain visible when I hide them
    text
    copied!<p>Feeling I had not enough control over the chart if I had used a grouped column chart, I made my own version by just adding different series to the chart. After all the store, the number of series, their colors and such all need to be set dynamically and not hard coded. So basically this is what I have:</p> <pre><code>chart = Ext.create("Ext.chart.Chart", { store: dataStore, axes: dynamicAxes, series: series }); </code></pre> <p>I leave out the not interesting stuff such as width, height of the chart etc. now I have a method whichs returns a series object. This is added to the series array mentioned in the code above. The function has a "item" object parameter and also an idx param which is the index of the item object from the array it comes from, and a max param which is the size of the item array</p> <p>the function returns something like this:</p> <pre><code>var w = (typeof (max) !== "undefined" &amp;&amp; max !== null) ? this._getWidthByMax(max) : 30; return { type: "column", axis = "left", xField = "timestamp", yField = item.id, // store field name equals the id of the item object style = { stroke: colorCode, "stroke-width": (item.isDefault) ? 2 : 1, fill: colorCode }, width = w, renderer = function (sprite, rec, attr, bix) { var nx = idx * w; return Ext.apply(attr, { translation: { x: nx} }); } } </code></pre> <p>now this works fine for the number of columns I want to have. That can be one, two, three... up to seven currently. However, if I want to hide a series, the following call doesn't work:</p> <pre><code>chart.series.getAt(idx).hideAll(); </code></pre> <p>while it does work if I render my chart as a line chart. is this a bug in Ext-js 4 or is it because of how I rendered the series for my column chart?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload