Create line chart windows form

1

Hello, I need to create graphs in windows form in dynamic ways, this is working correctly, but I would like the graphic to be offline, since it is bar graph, could anyone help me? Code:

  private void FrmGrafico_Load(object sender, EventArgs e)
    {
        GraficoDS.LinhaRolosDataTable dt = new GraficoDS.LinhaRolosDataTable();
        LinhaRolosTableAdapter ta = new LinhaRolosTableAdapter();

        ta.Fill(dt, IDLinhaRolos);
        chartGrafico.DataBindTable(dt);
    }

Graphic generated:

    
asked by anonymous 31.08.2017 / 18:06

2 answers

0

Only change ChartType . You can see all possible values in the documentation .

chartGrafico.Series[0].ChartType = 
    System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line;
    
31.08.2017 / 18:26
0

This control is done by the series of the graph, as there may be more than one type for different series, that is, you can mix column graphs with line graphs.

You can access these properties at run time or at design time.

At Design time, simply change the chart type in the series properties. See image below:

    
31.08.2017 / 18:29