Download the free trial version
Questions (Windows Mobile) Post any question regarding Basic4ppc.
ChartsDevice.dll thick line at bottom of chart
12-27-2008, 12:11 PM
ChartsDevice.dll thick line at bottom of chart
For some reason when I use the ChartsDevice dll (and same on the desktop)
I get a thick line just above the x-axis going from position 0 to about 9 tenth
of the x-axis. I noticed the provided example (the line chart) does the same and I have no idea how to get rid of it.
Any ideas?
RBS
12-27-2008, 01:21 PM
Basic4ppc Expert
Assuming that you mean the line at y = 0 it is there by design to show the y axis origin.
12-27-2008, 03:13 PM
I attached a .gif file that shows what I am talking about.
The line in this image runs till the 9 in the second date.
RBS
12-27-2008, 03:17 PM
Basic4ppc Expert
I don't see anything like that in the line chart example, Can you post the code that created the chart so I can try it on my system.
12-27-2008, 03:32 PM
This code shows it with me:
Sub DrawLineChart
LineChart.New1(Image1.Width, Image1.Height)
LineChart.Text = "BP values"
LineChart.Color = Rgb(255,255,230)
LineChart.ColorGradient = cBlue
LineChart.GridSpacingValue = 20
LineChart.MaxScaleValue = 180
LineChart.MinScaleValue = 80
LineChart.ShowGrid = False
LineChart.BorderSize = 10
LineChart.MarginForTextOnAxis = 10
LineChart.XAxisIntervalValue = 1
LineChart.AddXAxisText(240,240, "")
LineChart.NewLine(cRed)
LineChart.AddPoint(0, 160)
LineChart.AddPoint(1, 150)
LineChart.AddPoint(2, 155)
LineChart.AddPoint(3, 170)
LineChart.AddPoint(4, 180)
LineChart.AddPoint(5, 150)
LineChart.AddPoint(6, 140)
linechart.ShowGrid = True
LineChart.AddLine
LineChart.NewLine(cBlue)
LineChart.AddPoint(0, 90)
LineChart.AddPoint(1, 85)
LineChart.AddPoint(2, 90)
LineChart.AddPoint(3, 100)
LineChart.AddPoint(4, 110)
LineChart.AddPoint(5, 80)
LineChart.AddPoint(6, 140)
LineChart.AddLine
LineChart.NewLine(cGreen)
LineChart.LineWidth = 1
LineChart.AddPoint(0, 85)
LineChart.AddPoint(5, 25)
LineChart.AddPoint(10, 65)
LineChart.AddPoint(15, 75)
LineChart.AddPoint(20, 10)
LineChart.AddTrendLine
Image1.Image =LineChart.Draw
End Sub
RBS
12-27-2008, 04:39 PM
Basic4ppc Expert
Join Date: Oct 2007
Location: Fully, Switzerland
Posts: 3,827
Awards Showcase
I have looked at your code.
The code you posted doesn't match your image, why didn't you post the right code?
The problem lies in the line
Code:
<font face= " Courier New " ><font size= " 2 " ><font face= " Courier New " ><font size= " 2 " >LineChart.AddXAxisText(</font></font></font></font><font face= " Courier New " ><font size= " 2 " ><font color= " #800080 " ><font face= " Courier New " ><font size= " 2 " ><font color= " #800080 " ><font face= " Courier New " ><font size= " 2 " ><font color= " #800080 " > 240 </font></font></font></font></font></font></font></font></font><font face= " Courier New " ><font size= " 2 " ><font face= " Courier New " ><font size= " 2 " >,</font></font></font></font><font face= " Courier New " ><font size= " 2 " ><font color= " #800080 " ><font face= " Courier New " ><font size= " 2 " ><font color= " #800080 " ><font face= " Courier New " ><font size= " 2 " ><font color= " #800080 " > 240 </font></font></font></font></font></font></font></font></font><font face= " Courier New " ><font size= " 2 " ><font face= " Courier New " ><font size= " 2 " >, </font></font></font></font><font face= " Courier New " ><font size= " 2 " ><font color= " #800000 " ><font face= " Courier New " ><font size= " 2 " ><font color= " #800000 " ><font face= " Courier New " ><font size= " 2 " ><font color= " #800000 " > "" </font></font></font></font></font></font></font></font></font><font face= " Courier New " ><font size= " 2 " ><font face= " Courier New " ><font size= " 2 " >)</font></font></font></font>
if you replae it by
Code:
<font face= " Courier New " ><font size= " 2 " ><font face= " Courier New " ><font size= " 2 " >LineChart.AddXAxisText(</font></font></font></font><font face= " Courier New " ><font size= " 2 " ><font color= " #800080 " ><font face= " Courier New " ><font size= " 2 " ><font color= " #800080 " ><font face= " Courier New " ><font size= " 2 " ><font color= " #800080 " > 0 </font></font></font></font></font></font></font></font></font><font face= " Courier New " ><font size= " 2 " ><font face= " Courier New " ><font size= " 2 " >,</font></font></font></font><font face= " Courier New " ><font size= " 2 " ><font color= " #800080 " ><font face= " Courier New " ><font size= " 2 " ><font color= " #800080 " ><font face= " Courier New " ><font size= " 2 " ><font color= " #800080 " > 20 </font></font></font></font></font></font></font></font></font><font face= " Courier New " ><font size= " 2 " ><font face= " Courier New " ><font size= " 2 " >, </font></font></font></font><font face= " Courier New " ><font size= " 2 " ><font color= " #800000 " ><font face= " Courier New " ><font size= " 2 " ><font color= " #800000 " ><font face= " Courier New " ><font size= " 2 " ><font color= " #800000 " > "" </font></font></font></font></font></font></font></font></font><font face= " Courier New " ><font size= " 2 " ><font face= " Courier New " ><font size= " 2 " >)</font></font></font></font>
you get a 'normal' X axis.
With you code the program tries to draw no text at position 240.
Attached 2 images.
@agraham
In trying this example I noticed that the parameter MinScaleValue with posutive values has no effect.
Code:
<font face= " Courier New " ><font size= " 2 " ><font face= " Courier New " ><font size= " 2 " >LineChart.MinScaleValue=</font></font></font></font><font face= " Courier New " ><font size= " 2 " ><font color= " #800080 " ><font face= " Courier New " ><font size= " 2 " ><font color= " #800080 " ><font face= " Courier New " ><font size= " 2 " ><font color= " #800080 " > 20 </font></font></font></font></font></font></font></font></font>
Best regards.
__________________
Klaus
Switzerland
Last edited by klaus : 12-27-2008 at 04:42 PM .
12-27-2008, 04:49 PM
Basic4ppc Expert
There are two problems here
First this statment "LineChart.XAxisIntervalValue = 1" puts the X-axis ticks too close together for a maximum scale value of 240 so they run into each other as a grey bar.
Second, why then does the grey bar not extend to the end? The answer is that there is a bug in drawing the ticks when the max value of the X axis (which is determined by the max value defined in the AddXAxisText statements) is greater than the number of display pixels along the the X-axis. If you need a larger value than this the solution is to scale the X values to be less than that number of pixels.
@Klaus
Quote:
In trying this example I noticed that the parameter MinScaleValue with posutive values has no effect.
That is correct. MinScaleValue is intended for extending the Y value range into negative values. If it is greater than 0 it has no effect.
12-27-2008, 05:03 PM
Basic4ppc Expert
Join Date: Oct 2007
Location: Fully, Switzerland
Posts: 3,827
Awards Showcase
In my mind I would have expected, that if I had a chart with values between 80 and 100 and setting the MinScaleValue to 80 and MaxScaleValue to 100, getting a diagram with a streched Y scale from 80 to 100.
Unfortunately this seems not beeing the case.
Best regards.
__________________
Klaus
Switzerland
12-27-2008, 05:27 PM
> The code you posted doesn't match your image, why didn't you post the right code?
The code that produced the image I posted is a lot more complex and I would have to simplify it a lot. The code I posted is simple and shows the problem.
Will look at Graham's post now.
RBS
12-27-2008, 05:32 PM
Basic4ppc Expert
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Thread Tools
Display Modes
Linear Mode
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
All times are GMT. The time now is 05:07 AM .