Axes.Bottom.MaxXValue vs Axes.Bottom.Maximum

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
norman
Newbie
Newbie
Posts: 82
Joined: Fri Jan 25, 2008 12:00 am

Axes.Bottom.MaxXValue vs Axes.Bottom.Maximum

Post by norman » Thu Dec 04, 2008 1:06 pm

Hi,

Could some confirm if I'm understanding the difference between Axes.Bottom.MaxXValue and Axes.Bottom.Maximum correctly?

Is Axes.Bottom.MaxXValue the maximum x value of all the points in all the series that have been added to the chart, whereas Axes.Bottom.Maximum is the maximum x value of the axis. By default, Axes.Bottom.Maximum = Axes.Bottom.MaxXValue if Axes.Bottom.Automatic = True? But you can set Axes.Bottom.Maximum to any value if Axes.Bottom.Automatic = False?

Does the Axes.Bottom.SetMinMax method have to be called before you can access the value of Axes.Bottom.Maximum? When I tried outputting the value of Axes.Bottom.Maximum before calling this method I get 00:00:00. I've read including the line Dim bmp as Bitmap = WebChart1.Chart.Bitmap will force the Axes.Bottom.Maximum value to be updated but I get an error if I use this.

Thanks

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 Dec 04, 2008 1:24 pm

Hi Norman,
Is Axes.Bottom.MaxXValue the maximum x value of all the points in all the series that have been added to the chart, whereas Axes.Bottom.Maximum is the maximum x value of the axis. By default, Axes.Bottom.Maximum = Axes.Bottom.MaxXValue if Axes.Bottom.Automatic = True? But you can set Axes.Bottom.Maximum to any value if Axes.Bottom.Automatic = False?
Yes, that's almost correct. The only thing that should be changed is that MaxXValue is the maximum x value of all the points in all the series that have been *associated to the specified axis*.
Does the Axes.Bottom.SetMinMax method have to be called before you can access the value of Axes.Bottom.Maximum? When I tried outputting the value of Axes.Bottom.Maximum before calling this method I get 00:00:00. I've read including the line Dim bmp as Bitmap = WebChart1.Chart.Bitmap will force the Axes.Bottom.Maximum value to be updated but I get an error if I use this.


No, for Axes.Bottom.Maximum to be automatically calculated the chart needs to have been drawn. You can force this being internally done using TChart1.Draw() method before retrieving Maximum value. Draw() method does almost the same as Bitmap method.

Hope this helps!
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

norman
Newbie
Newbie
Posts: 82
Joined: Fri Jan 25, 2008 12:00 am

Post by norman » Thu Dec 04, 2008 2:05 pm

Hi,

WebChart1.Chart.Draw() results in error Overload resolution failed because no accessible 'Draw' accepts this number of arguments.

Thanks

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 Dec 04, 2008 2:26 pm

Hi norman,

Sorry, that's for WinForms chart only. You could try doing this:

Code: Select all

		Bitmap bmp = WebChart1.Chart.Bitmap((int)WebChart1.Width.Value, (int)WebChart1.Height.Value); 
In VB should be like this:

Code: Select all

Dim bmp As Bitmap = WebChart1.Chart.Bitmap(CType(WebChart1.Width.Value,Integer), CType(WebChart1.Height.Value,Integer))
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

norman
Newbie
Newbie
Posts: 82
Joined: Fri Jan 25, 2008 12:00 am

Post by norman » Thu Dec 04, 2008 3:15 pm

Sorry not sure but it doesn't seem to work - see

Code: Select all

Dim series As New Steema.TeeChart.Styles.Line
series.Pointer.Style = PointerStyles.Circle
series.Pointer.Visible = True
series.XValues.DateTime = True

For i As Integer = 0 To 999
   series.Add(today.AddDays(-i), i * 10)
Next

WebChart1.Chart.Series.Add(series)

Dim bmp As Bitmap = WebChart1.Chart.Bitmap(CType(WebChart1.Width.Value, Integer), CType(WebChart1.Height.Value, Integer))

' WebChart1.Chart.Axes.Bottom.Maximum = 00:00:00
Response.Write("WebChart1.Chart.Axes.Bottom.Maximum: " & Date.FromOADate(WebChart1.Chart.Axes.Bottom.Maximum) & "<br>")
Response.Write("WebChart1.Chart.Axes.Bottom.Minimum: " & Date.FromOADate(WebChart1.Chart.Axes.Bottom.Minimum) & "<br>")

WebChart1.Chart.Axes.Bottom.SetMinMax(today.AddDays(-7), today)

' Now WebChart1.Chart.Axes.Bottom.Maximum is updated
Response.Write("WebChart1.Chart.Axes.Bottom.Maximum: " & Date.FromOADate(WebChart1.Chart.Axes.Bottom.Maximum) & "<br>")
Response.Write("WebChart1.Chart.Axes.Bottom.Minimum: " & Date.FromOADate(WebChart1.Chart.Axes.Bottom.Minimum) & "<br>")
Thanks

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 Dec 04, 2008 4:00 pm

Hi norman,

Commenting in the Bitmap method call works fine for me here:

Code: Select all

  Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    Dim series As New Steema.TeeChart.Styles.Line
    series.Pointer.Style = Steema.TeeChart.Styles.PointerStyles.Circle
    series.Pointer.Visible = True
    series.XValues.DateTime = True

    For i As Integer = 0 To 999
      series.Add(Today.AddDays(-i), i * 10)
    Next

    WebChart1.Chart.Series.Add(series)

    'Dim bmp As Drawing.Bitmap = WebChart1.Chart.Bitmap(CType(WebChart1.Width.Width.Value, Integer), CType(WebChart1.Height.Value, Integer))

    ' WebChart1.Chart.Axes.Bottom.Maximum = 00:00:00
    Response.Write("WebChart1.Chart.Axes.Bottom.Maximum: " & Date.FromOADate(WebChart1.Chart.Axes.Bottom.Maximum) & "<br>")
    Response.Write("WebChart1.Chart.Axes.Bottom.Minimum: " & Date.FromOADate(WebChart1.Chart.Axes.Bottom.Minimum) & "<br>")

    WebChart1.Chart.Axes.Bottom.SetMinMax(Today.AddDays(-7), Today)

    ' Now WebChart1.Chart.Axes.Bottom.Maximum is updated
    Response.Write("WebChart1.Chart.Axes.Bottom.Maximum: " & Date.FromOADate(WebChart1.Chart.Axes.Bottom.Maximum) & "<br>")
    Response.Write("WebChart1.Chart.Axes.Bottom.Minimum: " & Date.FromOADate(WebChart1.Chart.Axes.Bottom.Minimum) & "<br>")
  End Sub
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

norman
Newbie
Newbie
Posts: 82
Joined: Fri Jan 25, 2008 12:00 am

Post by norman » Thu Dec 04, 2008 4:15 pm

Ok thanks - I might download the latest version and see if that does it. Do I have to uninstall the previous version before installing the newer one?

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

Post by Narcís » Fri Dec 05, 2008 8:56 am

Hi norman,

Yes, old version should be uninstalled first.
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

norman
Newbie
Newbie
Posts: 82
Joined: Fri Jan 25, 2008 12:00 am

Post by norman » Fri Dec 05, 2008 9:55 am

Thanks Narcís

Post Reply