PDA

View Full Version : Linechart with multiple lines



Sinmar
14 Mar 2011, 1:11 AM
Hi everyone,
First poster and new to ExtJS here. I am trying to produce a linechart with multiple lines based on a single datastorerecord looking like this:

var resultSet1 = Ext.data.Record.create(
[
{name: 'Expense'},
{name: 'Income'},
{name: 'Period'},
{name: 'ProductSegment'},
{name: 'Result'}
]
);

The data might look like this:

{1000, 2000, "2010-01", "AAA", 1000},
{1000, 2000, "2010-01", "BBB", 1000},
{1000, 2000, "2010-02", "AAA", 1000},
{1000, 2000, "2010-02", "BBB", 1000},
{1000, 2000, "2010-03", "AAA", 1000},
{1000, 2000, "2010-03", "BBB", 1000}

Now, I want to produce lines each depending on ProductSegment. Let's say ProductSegment is "AAA" or "BBB". So if it is "AAA" I want "Income" to be the yfieldvalue for Line 1. If it is "BBB" I want "Income" to be the yfieldvalue Line 2. In other words "Income" is the yfield for two different lines selected by a field in the record. Only problems is how...
Does the question make sense?