Page 1 of 1
Axes.Bottom.MaxXValue vs Axes.Bottom.Maximum
Posted: Thu Dec 04, 2008 1:06 pm
by 13048070
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
Posted: Thu Dec 04, 2008 1:24 pm
by narcis
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!
Posted: Thu Dec 04, 2008 2:05 pm
by 13048070
Hi,
WebChart1.Chart.Draw() results in error Overload resolution failed because no accessible 'Draw' accepts this number of arguments.
Thanks
Posted: Thu Dec 04, 2008 2:26 pm
by narcis
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))
Posted: Thu Dec 04, 2008 3:15 pm
by 13048070
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
Posted: Thu Dec 04, 2008 4:00 pm
by narcis
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
Posted: Thu Dec 04, 2008 4:15 pm
by 13048070
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?
Posted: Fri Dec 05, 2008 8:56 am
by narcis
Hi norman,
Yes, old version should be uninstalled first.
Posted: Fri Dec 05, 2008 9:55 am
by 13048070
Thanks NarcĂs