WebChart Bottom Axis Labels Missing

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
tangone
Newbie
Newbie
Posts: 23
Joined: Tue Jun 26, 2007 12:00 am

WebChart Bottom Axis Labels Missing

Post by tangone » Tue May 06, 2008 5:35 am

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

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Tue May 06, 2008 9:22 am

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.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

tangone
Newbie
Newbie
Posts: 23
Joined: Tue Jun 26, 2007 12:00 am

Post by tangone » Thu May 08, 2008 1:02 am

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

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Thu May 08, 2008 8:51 am

Hi stephen,

After adding the custom labels you could try using this:

Code: Select all

Bitmap bmp = wChart.Chart.Bitmap;
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

tangone
Newbie
Newbie
Posts: 23
Joined: Tue Jun 26, 2007 12:00 am

Post by tangone » Thu May 08, 2008 9:52 am

Hi Narcís,

What is the purpose of adding this line:

Code: Select all

Bitmap bmp = wChart.Chart.Bitmap;
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

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Thu May 08, 2008 10:48 am

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.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

tangone
Newbie
Newbie
Posts: 23
Joined: Tue Jun 26, 2007 12:00 am

Post by tangone » Thu May 08, 2008 10:51 am

Hi Narcís,

I just found out what went wrong and the issue solved.
Sorry for inconvenience caused.

Thanks,
stephen

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Thu May 08, 2008 11:15 am

Hi stephen,

No problem, I'm glad to hear you solved the issue.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply