views:

5

answers:

0

I am getting a graph that looks correct except for the fact that all the labels are being rendered on the verticalAxis instead of being grouped (Normal and Abmormal). As an aside, in my real code, the date field is an actual Date object rather than a string, if that makes a difference.

var exampleData:ArrayCollection = new ArrayCollection([
{value:"Normal" date:"June 16, 2010"},
{value:"Abnormal" date:"June 30, 2010"},
{value:"Normal" date:"July 2, 2010"},
{value:"Abnormal" date:"July 3, 2010"}
]);

var chart:LineChart = new LineChart();
chart.dataProvider = data;

var hAxis:CategoryAxis = new CategoryAxis();
hAxis.categoryField = "date";
hAxis.dataProvider = data;
hAxis.title = "Date";
chart.horizontalAxis = hAxis;

var vAxis:CategoryAxis = new CategoryAxis();
vAxis.categoryField = "value";
vAxis.dataProvider = data;
vAxis.title = "Result";
chart.verticalAxis = vAxis;

var mySeries:Array = new Array();

var series:LineSeries = new LineSeries();
series.xField = "date";
series.yField = "value";
series.displayName = "Result";

mySeries.push(series);   
chart.series = mySeries;

var legend:Legend = new Legend();
legend.dataProvider = chart;

This is outputting all 4 labels for the data points, but the line on the chart only uses 2 of the ticks on the vAxis.

What can I do to stop these extra labels from rendering?

Thank you!

Adam Chettle