"Your Result"
"Your Result"
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
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi David,
Could you please send us a simple example project we can run "as-is" to reproduce the problem here? If you want there's no need to sending us your database, you can use random/manual data.
You can either post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.
Thanks in advance.
Could you please send us a simple example project we can run "as-is" to reproduce the problem here? If you want there's no need to sending us your database, you can use random/manual data.
You can either post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.
Thanks in advance.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi David,
Thanks for the example project but it's still not exactly clear to us which is the exact problem you are having. Could you please send us an image indicating the problem you are having and what you'd expect?
Thanks in advance.
Thanks for the example project but it's still not exactly clear to us which is the exact problem you are having. Could you please send us an image indicating the problem you are having and what you'd expect?
Thanks in advance.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi David,
Thanks for the example project. First of all, we think you shouldn't not iterate and assign the datasource several times to the series. Anyway, using code below you achieve what you requested.
Thanks for the example project. First of all, we think you shouldn't not iterate and assign the datasource several times to the series. Anyway, using code below you achieve what you requested.
Code: Select all
' '*Now fill in "Your Result" Use a Yellow Diamond on the BarStack
With rsGeneric
Dim X As Integer
X = 0
.MoveFirst
TChart4.Header.Text.Text = "APTT " & rsGeneric.Fields(5)
Do While Not .EOF
X = X + 1
With TChart4.Series(2)
.DataSource = rsGeneric
If rsGeneric.Fields(4).Value > 0 Then
.AddXY rsGeneric.Fields(4).Value, rsGeneric.Fields(3).Value, "", clTeeColor
' .YValues.ValueSource = rsGeneric.Fields(3).Name '*The Y Axis (Total)
' .XValues.Value(X) = rsGeneric.Fields(4).Value
End If
.Marks.Visible = False '*Don't show the individual values for each pint
.ShowInLegend = True '*Don't show the Series title
rsGeneric.MoveLast
End With
.MoveNext
Loop
End With
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Thanks Narcis.
Unfortunately, this still does not work. Using the code as you posted, I get the Blue bar (Total Count) and the Red Bar (Reagent Count) stacked, but no Yellow "Your Result" over the appropriate Increment value Stacked Bar. I take your point about the .DataSource, that was a mistake. However, it still will not give me the "Your Result" as shown on my sample document. Playing around with it, I get the single yellow diamond to appear, but in totally random places that bear no resemblence to the participants Increment group as listed in the Result table.
Thanks
Best regards.
David
Unfortunately, this still does not work. Using the code as you posted, I get the Blue bar (Total Count) and the Red Bar (Reagent Count) stacked, but no Yellow "Your Result" over the appropriate Increment value Stacked Bar. I take your point about the .DataSource, that was a mistake. However, it still will not give me the "Your Result" as shown on my sample document. Playing around with it, I get the single yellow diamond to appear, but in totally random places that bear no resemblence to the participants Increment group as listed in the Result table.
Thanks
Best regards.
David
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi David,
In that case you may need to check that the RecordSet returns the results you expect and assign it only once as series' DataSource.
In that case you may need to check that the RecordSet returns the results you expect and assign it only once as series' DataSource.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Hi David,
ok, I'm sorry but I'm not sure which is the result you expect. Have you tried to add the Series Data returned by the recordset manually ? This would help to know if the problem appears assigning the DataSource or if the value returned is not the expected.
ok, I'm sorry but I'm not sure which is the result you expect. Have you tried to add the Series Data returned by the recordset manually ? This would help to know if the problem appears assigning the DataSource or if the value returned is not the expected.
Pep Jorge
http://support.steema.com
http://support.steema.com