Page 1 of 1
WebChart Bottom Axis Labels Missing
Posted: Tue May 06, 2008 5:35 am
by 13045688
Hi,
I have a webchart created and I would like to force to show all the bottom axis horizontal labels programmatically. How do I do that?
Thanks.
rgds,
stephen
Posted: Tue May 06, 2008 9:22 am
by narcis
Hi stephen,
You may want to read "Tutorials 4 - Axis Control" for axis settings information. You can also have a lookt at the custom labels feature in the features demo, available at TeeChart's program group. The example can be found at All Features\Welcome !\Axes\Labels\Custom labels.
Posted: Thu May 08, 2008 1:02 am
by 13045688
Hi Narcís,
I am able to get the custom labels using the following:
wChart.Chart.Axes.Bottom.Labels.Items.Add(value, name)
However, the labels only get displayed on second postback. If I perform wChart.Chart.Axes.Bottom.Labels.Items.Clear, the custom labels could not be displayed at all. But if I did not clear them, the labels were duplicated on every postback.
Please help!
Thanks,
stephen
Posted: Thu May 08, 2008 8:51 am
by narcis
Hi stephen,
After adding the custom labels you could try using this:
Posted: Thu May 08, 2008 9:52 am
by 13045688
Hi Narcís,
What is the purpose of adding this line:
I have added this line but I did not see any difference.
I tried to move it to the following function:
Code: Select all
Private Sub seriesHotspot1_GetHTMLMap(ByVal sender As Steema.TeeChart.Tools.SeriesHotspot, ByVal e As Steema.TeeChart.Tools.SeriesHotspotEventArgs)
If e.Series.GetType.Name.Contains("Horiz") Then
e.PointPolygon.Title = e.Series.Labels(e.PointPolygon.ValueIndex) + " " + Format(e.Series.XValues.Value(e.PointPolygon.ValueIndex), sender.Chart.Axes.Bottom.Labels.ValueFormat)
Else
e.PointPolygon.Title = e.Series.Labels(e.PointPolygon.ValueIndex) + " " + Format(e.Series.YValues.Value(e.PointPolygon.ValueIndex), sender.Chart.Axes.Left.Labels.ValueFormat)
End If
e.PointPolygon.HREF = "#"
Dim myProcess As String = "onclick=""javascript:__doPostBack('" + Me.Parent.ID + "#$#$#DrillDown#$#$#" + e.Series.Item(e.PointPolygon.ValueIndex).Label.ToString() + "', '" + sender.Chart.SubHeader.Text.ToString() + "');"""
e.PointPolygon.Attributes = String.Format(myProcess, e.PointPolygon.ValueIndex.ToString())
wChart.Chart.Axes.Bottom.Labels.Items.Add(e.Series.XValues.Value(e.PointPolygon.ValueIndex), e.Series.Labels(e.PointPolygon.ValueIndex))
Dim bmp As Bitmap = wChart.Chart.Bitmap
bmp.Save("c:\Temp\chart.bmp") 'just to see the output
End Sub
and I can see all the labels in the bitmap saved.
However, it is still not reflected in the Chart component output on the website.
By the way, the Chart that I created has "drill down" capabability.
It is not purely an image right?
Please help!
Thanks,
stephen
Posted: Thu May 08, 2008 10:48 am
by narcis
Hi stephen,
What is the purpose of adding this line:
Code:
Bitmap bmp = wChart.Chart.Bitmap;
This forces the chart being internally repainted. I suggested this to force custom labels being painted.
and I can see all the labels in the bitmap saved.
However, it is still not reflected in the Chart component output on the website.
Could you please send us a simple example project we can run "as-is" to reproduce the problem here? You can either post your files at news://
www.steema.net/steema.public.attachments newsgroup or at our
upload page.
By the way, the Chart that I created has "drill down" capabability.
It is not purely an image right?
Yes, when using HotSpots tool it's like a "map" image.
Thanks in advance.
Posted: Thu May 08, 2008 10:51 am
by 13045688
Hi Narcís,
I just found out what went wrong and the issue solved.
Sorry for inconvenience caused.
Thanks,
stephen
Posted: Thu May 08, 2008 11:15 am
by narcis
Hi stephen,
No problem, I'm glad to hear you solved the issue.