Jump to content
Software FX Community

yefchak

Members
  • Posts

    13
  • Joined

  • Last visited

Posts posted by yefchak

  1. Hi,

     I can successfully add an AnnotationPolygon to an "x-y" plot, but I'm not seeing how to do it with a contour plot.  It this supported?  I was hoping that AxisX.ValueToPixel and AxisY.ValueToPixel would somehow map onto the appropriate axes, but I guess not?

     Thanks,

    --George

  2. The rightmost label in the X-Axis (110...) is being clipped because the right margin is not big enough. This right space will not be adjusted automatically to make this label fit.

     

     

    Yes, that's it exactly.  I guess my question is, why can't the margin be adjusted automatically since the axis labels should never be clipped. (I can see the question might be less valid for annotation objects.)  In the mean, time, my solution is to allow the user to adjust the margin as illustrated.

    Thanks,
    --George 

  3. Please attach a screen shot of the chart so that we can understand how things are being cutoff.

    Sure, Frank.

    I've attached a screen shot which shows the issues (look at the right-hand size of the horizontal axis -- the text "11" is clipped off the side of the plot area) as well as showing the slightly insane window which I've had to create in order to avoid the problem.

    By allowing the user to edit the right and top margins of the plot as well as the ExportImageSize paramters, I'm able to ensure that the axis label text (and annotation text, not shown here) all fitss inside the plot area.  This seems to be a problem only when I set ExportImageSize to something fairly large (1600 x 1600 pixes) in this example, used here for a press-quality bitmap exported to the clipboard.  When a smaller size, similar the chart's actual dimensions on screen, is used eveything looks fine.

    Just so I'm clear, the image of the plot shown in this window isn't actually the live ChartFX.WinForms.Chart object, but rather a bitmap generated by calling myChart.Export(bitmapFormat, myStream).  The resulting bitmap is scaled to fit in the window, but of course the clipboard gets the full, unsqueezed bitmap.

    Thanks,

    --George

  4. Hi folks,

     

    A bit more info about my problem.  First, I'm using log axes... haven't had time to see if this fails with regular-mode axes as well.  When I specify a large ExportImageSize (e.g., 1650x1650) and increase the axis and/or annotation font size accordingly, the axis labels are often drawn such that large numbers can fall outside the chart's boundaries.  Reducing the font size doesn't help until the font is too small to be legible. 

    I'm searching for a way to fix this... anybody?

    Thanks,

    --George 

  5. Hi,

    I'm exporting a chart to the clipboard as follows (pseudocode):

     

    Dim stream as new memorystreamoriginalChart.Export(binary, stream)stream.position = 0dim newChart as new ChartnewChart.Import(binary, stream)newChart.left, right, top, width, etc. = originalChart.left, right, top, width, etc...newChart.AxisX.Font = New Font(newChart.AxisX.Font.Fontfamily, factor * originalChart.AxisX.Font.Size)  same for AxisY, etc.newChart.UpdateSizeNow()newChart.ExportImageSize = new Size(newWidth, newHeight)newChart.Export(bitmap, netastream)dim myImage as new Bitmap(metastream)My.Computer.Clipboard.SetImage(myImage)

     

    Note in particular the manipulation of the font size.  Basically this all works, EXCEPT sometimes a very large axis label (e.g., "10,000") on the right-hand edge of the chart will be cut off in the exported image.  And AnotationText objects (not shown in the code above, but treated in the same way) which fall above the top edge of the chart) are cut off as well.  These problems occur when my exported image size is large (e.g., for making a 300-dpi image).  When I keep everything at the original size (96 dpi), everything appears just as on screen.

    What's up? 

    Thanks!--George 

×
×
  • Create New...