Hi Alex,
Ihave acode block to dynamically populate/invoke another graph(aspx) onmouseover-
The chart is working fine, where as while setting the value foe the tooltip the value for
series.Points(pointIndex).AxisLabel
is ""
Here is my code-
myseries.ChartType = SeriesChartType.Column
ds = ObjAdmin_bo.GetBarChartData(txtStDt.Text.ToString, txtEndDt.Text.ToString) 'Date.Today.ToShortDateString.ToString) '
If ds.Tables(0).Rows.Count < 1 Then
pnlErrorMsg.Visible = True
ServerErrorMessage.Text = "No matching records found."
Else
ServerErrorMessage.Text = ""
End If
myseries.Points.DataBindXY(ds.Tables(0).Rows, "LetterCount", ds.Tables(0).Rows, "workdays")
Chart1.Series.Add(myseries)
Chart1.Series(0).IsValueShownAsLabel = True
'Chart1.ChartAreas(0).AxisX.Interval = 1
' Set series tooltips
Dim series As Series
For Each series In Chart1.Series
Dim pointIndex As Integer
For pointIndex = 0 To series.Points.Count - 1
Dim toolTip As String = ""
toolTip = "<IMG SRC=LogsListDetails.aspx?dcnt=" + series.Points(pointIndex).AxisLabel + "&sdt=" + txtStDt.Text.ToString + "&edt=" + txtEndDt.Text.ToString + ">"
series.Points(pointIndex).MapAreaAttributes = "onmouseover=""DisplayTooltip('" + toolTip + "');"" onmouseout=""DisplayTooltip('');"""
'series.Points(pointIndex).Href = "DetailedRegionChart.aspx?region=" + series.Points(pointIndex).AxisLabel
Next pointIndex
Next series
When I debug, the value for series.Points(pointIndex).AxisLabel
is "".
Will appreciate your quick help.
Thanks, Krishna
I got a work around to the issue by adding a for loop and assigning the AxisLabel values manually.....
For i As Integer = 0 To Chart1.Series(0).Points.Count - 1
Dim Y_val As String = ds.Tables(0).Rows(i)("LetterCount").ToString()
Dim X_val As String = ds.Tables(0).Rows(i)("workdays").ToString()
'Chart1.Series(0).Points(i).ToolTip = "Days=" + X_val + "LCnt=" + Y_val
Chart1.Series(0).Points(i).ToolTip = X_val
Chart1.Series(0).Points(i).AxisLabel = X_val.ToString
Next
Where as in my next code block
Dim series As Series
For Each series In Chart1.Series
Dim pointIndex As Integer
For pointIndex = 0 To series.Points.Count - 1
Dim toolTip As String = ""
toolTip = "<IMG SRC=Details.aspx?dcnt=" + series.Points(pointIndex).AxisLabel + "&sdt=" + txtStDt.Text.ToString + "&edt=" + txtEndDt.Text.ToString + ">"
series.Points(pointIndex).MapAreaAttributes = "onmouseover=""DisplayTooltip('" + toolTip + "');"" onmouseout=""DisplayTooltip('');"""
series.Points(pointIndex).Href = "LogsListDetails.aspx?dcnt=" + series.Points(pointIndex).AxisLabel + "&sdt=" + txtStDt.Text.ToString + "&edt=" + txtEndDt.Text.ToString
Next pointIndex
Next series
it says "Href" is not a member of System.Web.UI...... where as I have taken the code from the Samples environment
and when I comment the line
'series.Points(pointIndex).Href = "Details.aspx?dcnt=" + series.Points(pointIndex).AxisLabel + "&sdt=" + txtStDt.Text.ToString + "&edt=" + txtEndDt.Text.ToString<br/>
I get an script error while debugging at the line(dynamic debug mode) for .aspx
<map name="ctl00_MainContent_Chart1ImageMap" id="ctl00_MainContent_Chart1ImageMap">
<area shape="rect" coords="691,270,725,328" title="3" onmouseover="DisplayTooltip('<IMG SRC=Details.aspx?dcnt=3&sdt=09/01/2008&edt=10/01/2008>');" onmouseout="DisplayTooltip('');" alt="" />
saying object expected.
Will appreciate any quick help...!!
Thanks, Krishna