This is a migrated thread and some comments may be shown as answers.

Bind DateTimeComponent

1 Answer 64 Views
ChartView
This is a migrated thread and some comments may be shown as answers.
Nico
Top achievements
Rank 1
Nico asked on 11 Apr 2019, 12:09 PM

Hi there everyone,

I am currently trying to bind the DateTimeComponent attribute of the DateTimeCategoricalAxis to a property of my ViewModel. However, when I try to debug the application, it throws an exception essentially saying that I can't bind the DateTimeComponent as it is not a DependencyProperty. Granted, I am no expert at WPF, however reading this prompted me to think that this was no error on my side but rather a conscious decision made by Telerik. So currently I am looking for a way to dynamically set the units which are displayed on the x-axis of my chart. If you guys have any idea how I can get that to work with the DateTimeCategoricalAxis, that would be great, however solutions with other axes are also okay (DateTimeContinuousAxis does not work either, but for different reasons). 

Thanks in advance for your replies!

Best regards

Nico

1 Answer, 1 is accepted

Sort by
0
Nico
Top achievements
Rank 1
answered on 11 Apr 2019, 12:47 PM

Hey everyone,

I kinda figured it out. For me, it just worked to omit the DateTimeComponent field, then it automatically by the most precise category it can find. So if you e.g. set all the values for hour, minute, second etc. to zero it will just go by the next most precise field which in this case would be the day.

Tags
ChartView
Asked by
Nico
Top achievements
Rank 1
Answers by
Nico
Top achievements
Rank 1
Share this question
or