Jump to content
Software FX Community

Problem setting SerLeg to custom strings


Recommended Posts



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.



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();

Link to comment
Share on other sites

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...