Home Forums WinForms controls Xceed Chart for WinForms Chart support for .NET without forms

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #18797 |

    I am trying to use to the chart controls to generate graphs from my data. The problem is I wanted to just create and save graph images and am not keen on using forms.

    Basically I want to do something like below:

    1. Construct a chart (or a chartcontrol)
    2. Add my bar chart (for example) with all the data I need
    3. Save the resulting chart as an image file

    Is it possible for me to do this using the Xceed tool?

    Imported from legacy forums. Posted by asterix (had 2766 views)

    User (Old forums)
    Member
    Post count: 23064

    This is possible. Here is a code snippet showing how to do this :

    <code>
    private void Form1_Load( object sender, EventArgs e )
    {
    ChartControl chartControl = new ChartControl();
    Chart chart = chartControl.Charts[ 0 ];

    BarSeries barSeries = chart.Series.Add( SeriesType.Bar ) as BarSeries;

    barSeries.Add( 10 );
    barSeries.Add( 30 );
    barSeries.Add( 20 );

    chartControl.ImageExport.SaveToImageFile(
    @”D:\temp\chart.jpeg”,
    new Size( 640, 480 ),
    System.Drawing.Imaging.PixelFormat.Format24bppRgb,
    System.Drawing.Imaging.ImageFormat.Jpeg,
    100,
    false );
    }
    </code>

    Imported from legacy forums. Posted by André (had 3319 views)

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.