-
Dec 3rd, 2020, 08:28 PM
#1
Thread Starter
Addicted Member
Last edited by clickman; Dec 3rd, 2020 at 08:45 PM.
-
Dec 4th, 2020, 03:51 AM
#2
Re: Strange Chart Printing
-
Dec 4th, 2020, 06:11 AM
#3
Thread Starter
Addicted Member
Re: Strange Chart Printing
Originally Posted by Arnoutdv
Have taken a quick dive.. thanks so much for posting this. It looks promising..
I have worked a "solution" thus far by adding a "dummy line" via an x-y array element to the charted data points. This is a 2 point line that extends to a positive X and positive Y and has the x-y value set in the code at a Form|Initialize ( Recall, I have X from 0 to positive numbers, and Y from 0 to negative numbers. This dummy line "plots" outside this range. I say "plots' because even though it is there, it does no show up in the chart at run time because it is outside the bounds area specified by my grid axis settings at design time and also at run time.)
Code:
Private Sub Form_Initialize()
'< 255>
'... these are values used to set the initial size of the X-Y grid scale
'these are necessary to ge the pdf to print correctly
int_X_ScaleValue = 40
int_Y_ScaleValue = 60
'</ 255>
End Sub
I then "plot this dummy line by initializing it"
Code:
Private Sub Initialize_CLineArray()
'<EhHeader>
'On Error GoTo Initialize_CLineArray_Err
'</EhHeader>
'...these are manulaly set at the frmLoad
'int_X_ScaleValue = 40
'int_Y_ScaleValue = -60
100 CLineArray(1).X = 0
102 CLineArray(1).Y = 0
104 CLineArray(2).X = int_X_ScaleValue 'the 40 set at frmLoad
106 CLineArray(2).Y = int_Y_ScaleValue 'the 60 set at frmload
End Sub
I can change these int_X_ScaleValue(s) according to a command button (e.g., cmd_ScaleValue80 where the int_ScaleValue resets to 80 from the initial 40), and this resets the CLineArray(2).X and Y to the values assigned. This then creates the necessary revised dummy /placeholder line of the correct x and y to override what was set in the mschart object properties at design time.
This plots this dummy line above the y=0, and therefore it is off the chart. However, somehow, this fakes out the image that is clipboarded, and makes it print correctly. I bolded this because I think that this fake-out of some sort is the key to getting things to clipboard correctly, because the clipboard is picking up "more" than what you see on the screen at runtime as a displayed msChart, and it is the "more" that is also printed. It is as if what we see on the screen on simply a window to the overall chart and one must set this window dimension to over-ride what one sets in the properties page of teh MsChart itself.
It appears to me that the clipboarded image is picking up the default msChart|Properties|Axis (x) or (Y) of min and max that one can set by right clicking the chart object. Regardless of what you set your x and y max and mins to in your code, the clipboarded image seems to refer back to what you input into that default menu- unless you create a fake line to define the window.
All this written at 3am because it just would not let me sleep. I am pretty sure there is an elegant explanation of all this but this is what I have found, and what I "think" is going on. Of course, though, I am just like a monkey trying to paint a house.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|