Jump to content
Software FX Community
gdeutsch

xValue labels skip value in chart

Recommended Posts

The xValue labels does not match the data.

The chart is a barchart 

The xvlaue is a datetime

The first bar label has the second bar label value , and so on.

The chart appears with the last bar without label

 

 

 

Share this post


Link to post
Share on other sites

data:

 

Conteo Fecha
346 24/09/2008 09:03:25 a.m.
291 25/09/2008 12:00:04 a.m.
275 26/09/2008 12:00:34 a.m.
270 27/09/2008 12:00:13 a.m.
268 28/09/2008 06:28:31 p.m.
269 29/09/2008 12:00:24 a.m.

From a database query to a dataset:

 strsql="Query to obtain data"

TrysqlCmd = New SqlCommand(strSql, sqlConn)

sqlCmd.CommandType = CommandType.Text

sqlda = New SqlDataAdapter(sqlCmd)

dsGeneral =

New DataSetsqlda.Fill(dsGeneral, "Porcentaje")Catch Ex As SqlException

Cursor.Current = Cursors.Default

DisplaySQLErrors(Ex, strSql)

Exit Sub

End Try

sqlCmd =

Nothing

sqlda =

Nothing

Chart1.Data.Clear()

Chart1.DataSourceSettings.Fields.Clear()

If dsGeneral.Tables("Porcentaje").Rows.Count <> 0 Then

 

Chart1.LegendBox.Titles.Clear()

Chart1.LegendBox.Titles.Add(New TitleDockable("Asistencia"))

Chart1.DataSourceSettings.Fields.Add(

New FieldMap("Fecha", FieldUsage.XValue))Chart1.DataSourceSettings.Fields.Add(New FieldMap("Conteo", FieldUsage.Value))

 

Chart1.DataSource = dsGeneral.Tables("Porcentaje")

 

End If

 

 

 

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...