2 Replies - 4351 Views - Last Post: 20 July 2011 - 12:53 PM

#1 complete  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 103
  • Joined: 12-April 07

DateTime Data Problems in Silverlight and C#

Posted 19 July 2011 - 08:13 PM

DateTime Data Problems in Silverlight and C#

Hello Forum.

I am using VISI Fire in Silverlight and C# to produce some data charts. One style of chart allows stacked data to be displayed in colums the xaml code I am using looks like this
Posted Image

The chart i am trying to build is based on a visi fire chart example. if you go to http://www.visifire....ges_gallery.php and look at their stacked examples here http://www.visifire....rts_gallery.php you can see the xaml example I am trying to emulate.
http://i67.photobuck...o/post_this.png

But my chart comes out differently. mine has this odd overlaping date feature

Posted Image

Now, I have carefully stepped through the code and as far as I can tell, I have the same date for each data set pair.
Posted Image

I have stepped through this code and I have made sure that with each value for i, the years and the months for each data pair are exactly the same. So why is my graph so messed up?

Is there something wrong with they way I am using the DateTime class?

new DateTime((Int32) Year_Id,(Int32) SMonth_Id, (Int32)1);

Is This A Good Question/Topic? 0
  • +

Replies To: DateTime Data Problems in Silverlight and C#

#2 Curtis Rutland  Icon User is online

  • (╯□)╯︵ (~ .o.)~
  • member icon


Reputation: 4448
  • View blog
  • Posts: 7,744
  • Joined: 08-June 10

Re: DateTime Data Problems in Silverlight and C#

Posted 19 July 2011 - 09:05 PM

Ok, I don't understand something. Why are you setting the datapoints both in XAML and in C# code? One or the other, otherwise you end up with duplicate data.

Also, if you notice from the XAML example of the chart you're trying to match, they don't use that format for dates (since it's not a valid format)

http://www.visifire.....xml?version=11

They use normal dates, and use a format string in the axis tag.

Also, moving to the Silverlight forum.
Was This Post Helpful? 0
  • +
  • -

#3 complete  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 103
  • Joined: 12-April 07

Re: DateTime Data Problems in Silverlight and C#

Posted 20 July 2011 - 12:53 PM

View PostCurtis Rutland, on 19 July 2011 - 10:05 PM, said:

Ok, I don't understand something. Why are you setting the datapoints both in XAML and in C# code? One or the other, otherwise you end up with duplicate data.

Also, if you notice from the XAML example of the chart you're trying to match, they don't use that format for dates (since it's not a valid format)

http://www.visifire.....xml?version=11

They use normal dates, and use a format string in the axis tag.

Also, moving to the Silverlight forum.


I tried just setting up the data in C# and not in the XAML but I found out that if there was not a previously allocated space for the data, I ran into problems. There is not duplicated data. If you start at zero in the structure and put in fresh data, you override the existing data.

I got it working finally. I had to add some specification to the xaml.

Here is the fix:


<vc:Chart.AxesX>
    <vc:Axis ValueFormatString="MMM - yyyy" Padding="4" LineThickness="0" IntervalType="Months"  Interval="1"/>
</vc:Chart.AxesX>

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1