Hi all,
Since changing to a Group Stacked Series my chart behaves strange (Sample attached).
I think it has something to do with the way I call my ColumnChartViewModel Class or my Observable Collection? If I do it from within the Class itself it's fine:
Me.InternodeUsage = New ObservableCollection(Of InternodeUsage)()
Dim yr As New DateTime(2002, 5, 1)
InternodeUsage.Add(New InternodeUsage() With {.iDate = "12/02/2014", .iTotal = 0.45, .iUp = 0.1, .iDown = 4.5})
But if I do it from within my MainPage if doesn't work:
Dim InternodeData As New ColumnChartViewModel
Dim yr As New DateTime(2002, 5, 1)
InternodeData.InternodeUsage.Add(New InternodeUsage() With {.iDate = "12/02/2014", .iTotal = 0.45, .iUp = 0.1, .iDown = 4.5})
Using a standard Collum chart it all worked fine. Maybe I have been doing it wrong all along . . . ?
Can someone help?
Cheers, Leigh.
Hi Leigh,
We have analyzed the stated issue. The issue can be fixed by
changing the DateTime format for the given collection class as in the below
code snippet. Also, we have prepared the sample based on your query. Please download
it from the given below location.
Code snippet [C#]:
Dim yr As New DateTime(2002, 5, 1)
InternodeData.InternodeUsage.Add(New InternodeUsage() With {.iDate = "02/12/2014", .iTotal = 0.45, .iUp = 0.1, .iDown = 4.5})
InternodeData.InternodeUsage.Add(New InternodeUsage() With {.iDate = "02/13/2014", .iTotal = 5.35, .iUp = 0.2, .iDown = 1.5})
Please let us
know if you request further assistance on this.
Regards,
Suresh S.
Hi Suresh,
I am in Australia therefore 20/01/2013 is a valid date. When I run the sample now it throws an exception as it can't convert the string to date format. The sample I uploaded works . . . it just doesn't draw the chart correctly (Only shows the iTotal value not iUp, iDown and iTotal).
Thanks, Leigh.
Hi Leigh,
Sorry for the inconvenience caused. We have analyzed the
stated issue with your sample and we could find that ItemsSource for other
series are not provided, by adding as mentioned in the below code snippet the
sample is running without any issue. Please find the modified sample under the
following location.
Code Snippet [C#]:
Me.BottomHistoryChart.Series(1).ItemsSource = Nothing
Me.BottomHistoryChart.Series(1).ItemsSource =
InternodeData.InternodeUsage
Me.TopHistoryChart.Series(1).ItemsSource = Nothing
Me.TopHistoryChart.Series(1).ItemsSource =
InternodeData.InternodeUsage
Me.BottomHistoryChart.Series(2).ItemsSource = Nothing
Me.BottomHistoryChart.Series(2).ItemsSource =
InternodeData.InternodeUsage
Me.TopHistoryChart.Series(2).ItemsSource = Nothing
Me.TopHistoryChart.Series(2).ItemsSource =
InternodeData.InternodeUsage
Please let us know if you require further assistance on
this.
Regards,
Suresh S
Suresh . . .you are a legend. Can't believe I missed it.
Thanks it works perfect!
Thanks for your update.
We are glad that the issue resolved at your end. As always, we will be happy to assist you.
Regards,
Suresh S