Create an interface for populating the columns in a LineChartTool so we can have year values on the X axis.
|Assignee:||Krithika Manohar||% Done:|
We want to be able to create a line chart where the x axis is year and the y is some data value, where the data is formatted like the obesity-cube data table.
Each row has a record ID as its key, and then two other columns determine year and some other measure.
This can be done by adding a simple GUI where you select a column and it will build a list of EquationColumns and add them to the line chart columns.
You just have to loop over all the year values in the year column and add an EquationColumn to the line chart column list for each one.
Using the obesity-cube data table example:
For this to work, the keys in the line chart would have to be fips codes, which can be gotten like
fipsCol.getValueFromKey(cubeKey, IQualifiedKey) in ActionScript.
We then need a function to do a reverse-lookup (put this in in EquationColumnLib.as for now):
getKeysFromValue(column:IAttributeColumn, value:Object, dataType:*):Array
which would return a list of IQualifiedKey objects.
Then using fips keys from the line chart plotter, this equation would work:
fipsKey = getKey(), cubeKey = getKeysFromValue(fipsCol, fipsKey, QKey), (getValueFromKey(yearCol, cubeKey) == '1995') ? getValueFromKey(dataCol, cubeKey, Number) : NaN