Search code examples
xamlwinrt-xaml-toolkit

setup ColumnChart from WinRTXamlToolkit


I'm trying to setup Column Chart from WinRTXamlToolkit.
Let me ask:

Is there any guide for charts from this lib? Or which way you found the easiest to learn using charts?

How can I put labels near axises? In points like on below image:

  • P0: Times
  • P1: States

How to move labels above chart (like on below image)?

Thank you in advance!

enter image description here


Solution

  • I found "workarounds" (far away from perfection but works).

    Below WinRTXamlToolkit = WXT

    Fastest way (if you don't know WXT) is:

    To get column colors for legend do

    MethodInXamlBackingObject() {
       var paletteOfFirstColumn = ColumnChart.Palette[0];
       var columnFirstBrush = paletteOfFirstColumn["Background"];
    }
    

    BTW. tips where from to learn WXT:

    • analyse sources of samples in WXT - these are very detailed
    • analyse WXT behaviour with tool "WXT Debug Console" (included in demo app) - very powerfull
    • read arts about WXT and WPF Toolkit (from which WXT is a fork)