Please rate your dining experience [How to: Show text labels on a numeric axis with Silverlight/WPF Toolkit Charting]

This blog has moved to a new location and comments have been disabled.

All old posts, new posts, and comments can be found on The blog of

See you there!

Comments (7)
  1. Quinton says:

    Nice sample, I think there aren't enough good samples on the web about the charting controls.

    Just a quick observation, why do you have so many nested if statements, why not just use a switch statement?

  2. David Anson says:


    Thanks! You may not be aware that I maintain a list of a bunch of useful Toolkit Charting resources – the latest copy can always be found at Please have a look there – many of the common scenarios are covered by linked blogs written by various folks.

    Regarding the if structure above, I'd normally use a switch as you suggest, but for some reason I felt "iffy" when I was coding this up. šŸ™‚ No good reason, sorry about that!

    Aside: I wouldn't actually call this "nested" if statements because it's using "else if" rather than embedding a new "if" in the "else" of the previous one – but I get your point. šŸ™‚

  3. Quinton says:

    Thanks for the link, definately going to use it to get acquianted with the charting controls in the toolkit!

    And yes, you are correct, it's definately not a nested if, my bad, haha.

  4. Jacques says:

    Thanks a lot for the .Net 4 version of the charting toolkit. I'm using it intensively.

    I have a question about the dll: Is it compiled for "x86", "x64" or "Any CPU"?

    I ask that because I can't run on one of those "cool and super-fast" Windows 7 x64 machine the app I've compiled on my "Not so old but already vintage" x32 XP Pro machine with the Any CPU flag.

  5. David Anson says:


    I compile for "Any CPU" which means that the Data Visualization assembly should automatically match the application that loads it. If that application is x86, then the process and DataVis will be x86 – if x64, then all will be x64 – if Any CPU, then it will match the host machine architecture. Basically, if you can get the application to run, then adding a reference to the Data Visualization assembly and using the charts should not cause any problems or break anything.

  6. Jacques says:

    I was sure about the quality of your job šŸ™‚

    I guess that the problem is on my side: long-long nights in perspective !!!!

    Thanks for your super fast answer .


  7. DaneTritle says:

    Exactly what I was looking for.  Iā€™m coding a chart that calls for displaying points against a left dependent Y axis in minutes per mile (5:00, 6:00, 7:00, etc.).  The values are represented internally as seconds (per mile), and I was surprised that it turned out to be non-trivial in WPF.  I used a value converter to get from the data object to scalar points on the Y, but then the XAML left me hanging for formatting the custom text on the labels.  Your solution plugged in nicely, and the labels as desired.  Thanks so much!

Comments are closed.

Skip to main content