Good morning, I would like if you can help me I am making a statistical graph with chart in asp.net c # for which the graph already came out but what does not come out is that I want the real number to appear in each bar, for example like this Like the picture
Currently it comes out but without those numbers above and that is what I would like
Currently this is my code in html .
<asp:Chart ID="Chart1" runat="server" Width="600px">
<Titles>
<asp:Title Text="Costo Mensual"></asp:Title>
</Titles>
<Series>
<asp:Series Name="Series1" XValueMember="0" YValueMembers="2">
</asp:Series>
</Series>
<ChartAreas>
<asp:ChartArea Name="ChartArea1">
</asp:ChartArea>
</ChartAreas>
</asp:Chart>
and in the code:
DataSet ds = new DataSet();
SqlConnection cn = new SqlConnection(ObtenerCadenaConexion());
cn.Open();
SqlCommand cmd2 = new SqlCommand("GenerarBarraLineal", cn);
cmd2.CommandType = CommandType.StoredProcedure;
cmd2.Parameters.Add("@opt", SqlDbType.Int);
cmd2.Parameters.Add("@anio", SqlDbType.VarChar);
cmd2.Parameters.Add("@suministro", SqlDbType.VarChar);
cmd2.Parameters["@opt"].Value = 1;
cmd2.Parameters["@anio"].Value = cboPeriodo.SelectedItem.Text;
cmd2.Parameters["@suministro"].Value = "";
cmd2.ExecuteNonQuery();
SqlDataAdapter da = new SqlDataAdapter(cmd2);
da.Fill(ds);
Chart1.DataSource = ds;
cn.Close();
I think you are looking for this:
inside the series tag, which would leave you like this: