"Your Result"
Posted: Sun Jun 01, 2008 6:15 pm
Hello
I have a problem that I can't seem to solve.
I have a stacked bar chart that shows a particular reagent count stacked with the total reagent count against the value obtained by the reagent. So, a typical graph would have a Y -axis called Count, and an X -axis with Grouped results. No problem there at all.
My problem comes when I want to indicate a "Your Result" on one of the stackbars. I am using a Point Series (Diamond) to illustrate where "Your Result" fits along the Result Group X-Axis, and a point (I chose the Total Count field of the recordset ) on the Y-Axis to just lift the Diamond from the baseline X-Axis. But, I can't get it to do this. I get my Diamond point..but I get lots of Diamond points, not a single "Your Value". These points also don't appear to be fitted to teh correct Group Result Stackbar either.
To clarify:
The Count/Total Count and Result Group axis render all OK, but I can't get my "Your Result" to show in one place, ie, on the appropriate "Result Group column of the X-axis, and the Count of the Y-Axis.
My graph recordset is built thus from a series of sql's:
..............
.........
....
If rsGeneric.RecordCount > 0 Then
rsGeneric.MoveFirst
Do While Not rsGeneric.EOF
Increment = 0
With NewRs
.AddNew
!Survey = rsGeneric!Survey
Increment = rsGeneric!Increment
!Increment = Increment '*The Result Group value
!Count = rsGeneric!Count '*Reagent Only Count
!Total = rsGeneric!Total '*Total Count minus specific Reagent only count
If rsResult!Your_Result = Increment Then
!Your_Result = rsResult!Your_Result
Else
!Your_Result = -100 '*Just hide it on the graph
End If
!Reagent = rsGeneric!Reagent
.Update
End With
rsGeneric.MoveNext
Loop
.....
My Graph code looks like this:
rsGeneric datasource is derived from the recordset above
If rsGeneric.State = adStateOpen Then
TChart4.Header.Text.Text = "Test"
TChart4.Axis.Bottom.Title.Caption = "Result"
TChart4.Series(0).DataSource = "" '*Clear out any old datasource
TChart4.Series(1).DataSource = "" '*Clear out any old datasource
TChart4.Series(2).DataSource = "" '*Clear out any old datasource
If rsGeneric.RecordCount > 0 Then
TChart4.Header.Text.Text = "Reagent " & rsGeneric!Reagent
With TChart4.Series(0)
.Color = vbRed
.asBar.MultiBar = mbStacked
.DataSource = rsGeneric
.YValues.ValueSource = rsGeneric.Fields(2).Name '*The Y Axis (Reagent Count)
.LabelsSource = rsGeneric.Fields(1).Name '*The X Axis (Increment)
.Marks.Visible = False '*Don't show the individual values for each pint
.ShowInLegend = False '*Don't show the Series title
End With
With TChart4.Series(1)
.Color = vbBlue
.DataSource = rsGeneric
.YValues.ValueSource = rsGeneric.Fields(3).Name '*The Y Axis (Total) '*Total Count minus Reagent Count
.LabelsSource = rsGeneric.Fields(1).Name '*The X Axis (Increment)
.Marks.Visible = False '*Don't show the individual values for each pint
.ShowInLegend = False '*Don't show the Series title
End With
TChart4.Header.Text.Text = "Reagent " & rsGeneric!Reagent
ALL WORKS FINE TO HERE
' '*Now fill in "Your Result"
With rsGeneric
Dim X As Integer
X = 0
.MoveFirst
TChart4.Header.Text.Text = "Reagent " & rsGeneric.Fields(5)
Do While Not .EOF
X = X + 1
With TChart4.Series(2)
.DataSource = rsGeneric
.YValues.ValueSource = rsGeneric.Fields(3).Name '*The Y Axis '*Total Count minus Reagent Count
' .LabelsSource = rsGeneric.Fields(4).Name '*The X Axis (Your Result)
.Marks.Visible = False '*Don't show the individual values for each pint
.ShowInLegend = False '*Don't show the Series title
rsGeneric.MoveLast
Else
End If
End With
.MoveNext
Loop
End With
Else
TChart4.Header.Text.Text = "Test"
End If
End If
It is at this last Series(2) that I can't get "Your Result" to show properly.
Can anyone suggest what I am doing wrong here please?
Thank you
David
I have a problem that I can't seem to solve.
I have a stacked bar chart that shows a particular reagent count stacked with the total reagent count against the value obtained by the reagent. So, a typical graph would have a Y -axis called Count, and an X -axis with Grouped results. No problem there at all.
My problem comes when I want to indicate a "Your Result" on one of the stackbars. I am using a Point Series (Diamond) to illustrate where "Your Result" fits along the Result Group X-Axis, and a point (I chose the Total Count field of the recordset ) on the Y-Axis to just lift the Diamond from the baseline X-Axis. But, I can't get it to do this. I get my Diamond point..but I get lots of Diamond points, not a single "Your Value". These points also don't appear to be fitted to teh correct Group Result Stackbar either.
To clarify:
The Count/Total Count and Result Group axis render all OK, but I can't get my "Your Result" to show in one place, ie, on the appropriate "Result Group column of the X-axis, and the Count of the Y-Axis.
My graph recordset is built thus from a series of sql's:
..............
.........
....
If rsGeneric.RecordCount > 0 Then
rsGeneric.MoveFirst
Do While Not rsGeneric.EOF
Increment = 0
With NewRs
.AddNew
!Survey = rsGeneric!Survey
Increment = rsGeneric!Increment
!Increment = Increment '*The Result Group value
!Count = rsGeneric!Count '*Reagent Only Count
!Total = rsGeneric!Total '*Total Count minus specific Reagent only count
If rsResult!Your_Result = Increment Then
!Your_Result = rsResult!Your_Result
Else
!Your_Result = -100 '*Just hide it on the graph
End If
!Reagent = rsGeneric!Reagent
.Update
End With
rsGeneric.MoveNext
Loop
.....
My Graph code looks like this:
rsGeneric datasource is derived from the recordset above
If rsGeneric.State = adStateOpen Then
TChart4.Header.Text.Text = "Test"
TChart4.Axis.Bottom.Title.Caption = "Result"
TChart4.Series(0).DataSource = "" '*Clear out any old datasource
TChart4.Series(1).DataSource = "" '*Clear out any old datasource
TChart4.Series(2).DataSource = "" '*Clear out any old datasource
If rsGeneric.RecordCount > 0 Then
TChart4.Header.Text.Text = "Reagent " & rsGeneric!Reagent
With TChart4.Series(0)
.Color = vbRed
.asBar.MultiBar = mbStacked
.DataSource = rsGeneric
.YValues.ValueSource = rsGeneric.Fields(2).Name '*The Y Axis (Reagent Count)
.LabelsSource = rsGeneric.Fields(1).Name '*The X Axis (Increment)
.Marks.Visible = False '*Don't show the individual values for each pint
.ShowInLegend = False '*Don't show the Series title
End With
With TChart4.Series(1)
.Color = vbBlue
.DataSource = rsGeneric
.YValues.ValueSource = rsGeneric.Fields(3).Name '*The Y Axis (Total) '*Total Count minus Reagent Count
.LabelsSource = rsGeneric.Fields(1).Name '*The X Axis (Increment)
.Marks.Visible = False '*Don't show the individual values for each pint
.ShowInLegend = False '*Don't show the Series title
End With
TChart4.Header.Text.Text = "Reagent " & rsGeneric!Reagent
ALL WORKS FINE TO HERE
' '*Now fill in "Your Result"
With rsGeneric
Dim X As Integer
X = 0
.MoveFirst
TChart4.Header.Text.Text = "Reagent " & rsGeneric.Fields(5)
Do While Not .EOF
X = X + 1
With TChart4.Series(2)
.DataSource = rsGeneric
.YValues.ValueSource = rsGeneric.Fields(3).Name '*The Y Axis '*Total Count minus Reagent Count
' .LabelsSource = rsGeneric.Fields(4).Name '*The X Axis (Your Result)
.Marks.Visible = False '*Don't show the individual values for each pint
.ShowInLegend = False '*Don't show the Series title
rsGeneric.MoveLast
Else
End If
End With
.MoveNext
Loop
End With
Else
TChart4.Header.Text.Text = "Test"
End If
End If
It is at this last Series(2) that I can't get "Your Result" to show properly.
Can anyone suggest what I am doing wrong here please?
Thank you
David