Hello,
Can someone point me to where I'm going wrong? I'm doing a query on an Access database and passing the resultset to a chart control. The data comes back as 4 series so I'm trying to set the SerLeg properties to a human readable string for display but the resulting chart is still displaying the default "Expr1000" etc in the SerLegBox.
See the code snippet below.
Regards,
Neil
Code Snippet:
reportQuery = "SELECT SUM(IIf((HH15+HH16)>=1 And (HH15+HH16)<=3,1,0)), " + "SUM(IIf((HH15+HH16)>=4 And (HH15+HH16)<=6,1,0)), " + "SUM(IIf((HH15+HH16)>=7 And (HH15+HH16)<=9,1,0)), " + "SUM(IIf((HH15+HH16)>=10,1,0)) " + "FROM Census_Counts"; theChart.DataType[0] = DataType.Default; theChart.DataType[1] = DataType.Default; theChart.DataType[2] = DataType.Default; theChart.DataType[3] = DataType.Default; theChart.Legend[0] = ""; theChart.SerLeg[0] = "Households with 1-3 individuals"; theChart.SerLeg[1] = "Households with 4-6 individuals"; theChart.SerLeg[2] = "Households with 7-9 individuals"; theChart.SerLeg[3] = "Households with 10 or more individuals"; theChart.SerLegBox = true; theChart.AxisX.Title.Text = "Band"; theChart.AxisY.Title.Text = "No. Households"; theChart.AxisY.AdjustScale(); theChart.AxisY.LabelsFormat.Decimals = 0; theChart.Gallery = Gallery.Bar; theChart.LegendBox = false; theChart.PointLabels = true; theChart.Grid = ChartGrid.Horz; theChart.Chart3D = true; theChart.Titles[0].Text = "Household Size in Bands";
cmd.Connection = dbConnection; cmd.CommandText = reportQuery; adapter.SelectCommand = cmd; adapter.Fill(ds); theChart.DataSource = ds.Tables[0]; theChart.Refresh();