Charting library

Discussion in 'Additional Libraries' started by agraham, Feb 3, 2008.

  1. agraham

    agraham Expert Licensed User

    A charting library that can produce Bar, Line and Pie charts with an optional legend. Also the capability of saving images in several formats. Help file included. Requires .NET 2.0 and for the desktop only. I tried to port it to the device but had to give up. There is no GDI+ on the device and it would have been too big a rewrite. Also the bit of code that I (sort of) got working showed that the device really doesn't have enough resolution for this.

    No credit to me for the charting code. It is some example Microsoft code from 2002 that I have taken, debugged, marginally ehnanced and written a Basic4PPC front end.

    EDIT :- Device library and updated help added to zip.

    EDIT :- Version 1.1 posted with X axis "tick" bug fixed http://www.basic4ppc.com/forum/ques...ce-dll-thick-line-bottom-chart.html#post20472

    EDIT :- Version 1.2 posted, ChartsDevice is now VGA aware when used with Basic4ppc version 6.80 or later. See post #24.
     

    Attached Files:

    Last edited: Jun 10, 2009
  2. Erel

    Erel Administrator Staff Member Licensed User

    Nice job:

    [​IMG]

    [​IMG]

    [​IMG]
     
  3. yildi

    yildi Member Licensed User

    Thank you very much Agraham! This was an old wish of mine (I have already suggested this to Erel in a post). We will be totally spoiled if a device version of this library (or a similar one) can be developed. Any idea Erel?

    Regards,
    Murat
     
  4. agraham

    agraham Expert Licensed User

    Regard yourself spoiled. After starting over five times I finally made it work acceptably on the device. A few quirks probably remain. The device version is now posted in the zip together with the desktop version and an updated help. Because of the limited resolution on the device you may have to play around with properties a bit in order to get an acceptable chart.
     
  5. Heinz

    Heinz Active Member Licensed User

    Thank you,
    it's a nice library.
     
  6. yildi

    yildi Member Licensed User

    Wow Agraham,
    I definitely feel spoiled! Thank you very much for this new library :sign0098:

    Best regards,

    Murat
     
  7. Heinz

    Heinz Active Member Licensed User

    How can i print out the image (chart) in my program ?
    i don't want save it as image and print it with paint etc.
     
  8. agraham

    agraham Expert Licensed User

    Use the latest version (1.5) of my desktop only printing library here http://www.basic4ppc.com/forum/showpost.php?p=8057&postcount=27

    Use

    CopyImageToClipboard(Img AS Image) : Copies the specified image to the clipboard from where it may be pasted into a document. Image can be any source of an image in Basic4PPC. .e.g. Form.Image or ImageControl.Image or ImageList.Item(x) etc.

    And then

    PasteBitmap : If there is a bitmap on the clipboard it will be pasted into the RichTextBoxDesktop object. No control is available over size so some experimentation will be necessary to get the required result.

    You can do loads of other pretty stuff with text as well.
     
  9. Heinz

    Heinz Active Member Licensed User

    hello agraham,
    this was a brilliant idea.
    with only a few commands.

    Thank you verry much.

    Code:
    Sub Button3_Click
        RT.New1(
    "Form1"10310570180)
        RT.Clear
        RT.Visible = 
    False
        RT.CopyImageToClipBoard(Image1.Image)
        RT.PasteBitmap
        RT.PrintPreview
    End Sub
     
  10. agraham

    agraham Expert Licensed User

    Just in case you hadn't thought of it you can can control the horizontal position of the printed image with the Alignment property and/or the Tab method.
     
  11. manu

    manu Active Member Licensed User

    Thank you agrahan,

    it'si a nice work.
     
  12. davelew1s

    davelew1s Active Member Licensed User

    Help file

    Hi!
    I have only just found this charting library..and it works great but when I open the help file it says 'Page cannot be displayed', all other help files work OK... any help on help?
    Dave.
     
  13. Erel

    Erel Administrator Staff Member Licensed User

    There is an online version of this manual: Charts
     
  14. Bobbes

    Bobbes Active Member Licensed User

    Thanx agraham,
    that is very usefull for a Programm to displayed Weather or Bloodpresuredates

    Regards Bernd
     
  15. davelew1s

    davelew1s Active Member Licensed User

    Thanks Erel I searched the forum but this didn't show.
    Dave.
     
  16. agraham

    agraham Expert Licensed User

  17. klaus

    klaus Expert Licensed User

    Hi Andrew,

    In looking at Paulsche's question in the German forum, I was 'playing' a bit with the Chart library and more specifically with LineChart.

    Is there a reason why the MinScaleValue, MaxScaleValue and GridSpacingValue are Integer values, could these become Double?

    With MaxScaleValue = 1.2 I would have expected GridSpacingValue = 0.2 but it is rounded to 0.

    With MaxScaleValue = 1.2 without a line the MaxScaleValue becomes 1
    With MaxScaleValue = 1.2 and with a line with a max point value of 1.05 the MaxValue in the graph becomes this value and the GridSpacingValue on the graph the tenth but reading the MaxScaleValue and GridSpacingValue parameters these are rounded to an integer value.
    It seems that the values on the graph can be Doubles.

    The XAxisIntervalValue is a Double, but in the AddXAxisText method the interval values are integers. Could these also be changed to Doubles ?

    Attached the test program I payed with.

    Best regards.
     

    Attached Files:

    Last edited: Feb 17, 2009
  18. agraham

    agraham Expert Licensed User

    I tried the obvious and redeclared them as double but after fixing all the compilation errors about incompatible types it didn't work so deep down in the code (which is based on a Microsoft graphics example from the early days of .NET) there are probably some assumptions about integer working burnt in.

    There's quite a lot of interdependent code in there, particularly that concerned with scaling, so I'm afraid that I am not going to start digging around as it would take too much time to relearn what's going on.
     
  19. klaus

    klaus Expert Licensed User

    Hi Andrew,

    Thanks for the time you spent trying to improve the LineChart control.

    Unfortunately the Microsoft people are not always coherent.

    Best regards.
     
  20. Paulsche

    Paulsche Well-Known Member Licensed User

    Linechart XaxisText in Kollision with Y Zero Value

    Hello Agraham,

    I have my program converted to VGA, now is the line chart as shown, that the text in the X axis of the zero value of Y axis superimposed.

    Can I change the Y position of the text of the X axis somehow change?
     

    Attached Files:

Loading...