Jump to content
Software FX Community

Month and Year values in X Axis are repeating


Recommended Posts


I have data table like this :

Value1  Value2  Date

1077 830   2008-10-01 00:00:00.0001084   768   2008-11-01 00:00:00.0001135 774   2008-12-01 00:00:00.000

And I am trying to generate lines graph

 Html code:

  <CHARTFX:CHART id="Chart1" runat="server" Gallery="lines" Height="335px" Width="500px" BorderColor="#A8A8A8"             MarkerShape="None" LineWidth="2" PointLabels="True">             <AxisY Title-Text="Growth of $1,000"></AxisY>             <LegendBoxObj TextColor="ControlText" Docked="Bottom"></LegendBoxObj>             <SerLegBoxObj Docked="Bottom"></SerLegBoxObj>             <AxisX Title-Text="Date" MinorTickMark="None" LabelAngle="90">                   <LabelsFormat CustomFormat="MMM-dd-yy" Format="Date"></LabelsFormat>             </AxisX>         </CHARTFX:CHART>

VB code:

          Dim DV As DataView = objDataSet.Tables(0).DefaultView   DV.Sort = "Date" + " asc"   Chart1.DataSource = DV   Chart1.DataBind()

Here the problem is X Axis labels are showing more then 3 dates, depending on chart width the number of date values in x-axis are getting increased with deferent date intervals. In this graph the dates are showing like : oct-05-o8, oct-12-o8, oct-19-o8, oct-26-o8, nov-02-o8, nov-09-o8, nov-16-o8, nov-23-o8, nov-30-o8 and december got missed 

 I just want to display 3 dates in the x-axis as per the data table (oct-01-o8, nov-01-o8, dec-01-o8)

How can I do this, I tried NValues in the code but problem was still there


Thank you,


Link to comment
Share on other sites

Those dates are automatically generated by the chart itself.

You could change the data type of the x axis to be a string. This will force the chart to not to do it's awesome magic with dates on the x axis.

You can change the X Axis with the following line:

yourChart.AxisX.DataFormat = AxisFormat.None;

I might be wrong on the exact choice, but this should put you in the right step.

Link to comment
Share on other sites

  • 2 months later...

Have you tried this approach? It does not work at all. If the date format is set to AxisFormat.None then only numbers are displayed, not dates. Our customers are also complaining about the repeated dates. What is the real solution to the repeating dates? Does SoftwareFX have a solution?

Thank you.

Link to comment
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.

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.

  • Create New...