We are working hard to improve our charting component for Windows Phone 7 and to make it more and more feature-rich. And we are happy to share that as of Service Pack 1 of the Mango build of our tools, RadChart gets “Palette” support. A Palette may be thought of as a collection of brushes that define the look-and-feel of chart series and data points. The API is quite flexible and allows you to create custom palette or to select from the built-in ones. Two predefines palettes are currently available – Contrast and Warm. To simplify the usage we have created a smart design-time converter that lists the predefined palettes so that you do not need to know their exact names but just to pick an option:

And here is how the “Warm” Palette is defined in XAML:

<telerikChart:ChartPalette>
  <telerikChart:ChartPalette.SeriesEntries>
    <telerikChart:PaletteEntryCollection SeriesFamily="Area">
      <telerikChart:PaletteEntry Fill="#E520B0D4"/>
      <telerikChart:PaletteEntry Fill="#E5C32E0A"/>
      <telerikChart:PaletteEntry Fill="#E5FA6F5E"/>
      <telerikChart:PaletteEntry Fill="#E521B573"/>
      <telerikChart:PaletteEntry Fill="#E588CA2A"/>
      <telerikChart:PaletteEntry Fill="#E5FF921E"/>
      <telerikChart:PaletteEntry Fill="#E5006968"/>
      <telerikChart:PaletteEntry Fill="#E57A6CC4"/>
    </telerikChart:PaletteEntryCollection>
    <telerikChart:PaletteEntryCollection SeriesFamily="Line">
      <telerikChart:PaletteEntry Stroke="#FF1FAFD3"/>
      <telerikChart:PaletteEntry Stroke="#FFC32E0A"/>
      <telerikChart:PaletteEntry Stroke="#FFFA6F5E"/>
      <telerikChart:PaletteEntry Stroke="#FF21B573"/>
      <telerikChart:PaletteEntry Stroke="#FF88CA2A"/>
      <telerikChart:PaletteEntry Stroke="#FFFF921E"/>
      <telerikChart:PaletteEntry Stroke="#FF006968"/>
      <telerikChart:PaletteEntry Stroke="#FF7A6CC4"/>
    </telerikChart:PaletteEntryCollection>
    <telerikChart:PaletteEntryCollection SeriesFamily="Pie">
      <telerikChart:PaletteEntry Fill="#FF1FAFD3"/>
      <telerikChart:PaletteEntry Fill="#FFC32E0A"/>
      <telerikChart:PaletteEntry Fill="#FFFA6F5E"/>
      <telerikChart:PaletteEntry Fill="#FF21B573"/>
      <telerikChart:PaletteEntry Fill="#FF88CA2A"/>
      <telerikChart:PaletteEntry Fill="#FFFF921E"/>
      <telerikChart:PaletteEntry Fill="#FF006968"/>
      <telerikChart:PaletteEntry Fill="#FF7A6CC4"/>
    </telerikChart:PaletteEntryCollection>
    <telerikChart:PaletteEntryCollection SeriesFamily="Bar">
      <telerikChart:PaletteEntry Fill="#FF1FAFD3"/>
      <telerikChart:PaletteEntry Fill="#FFC32E0A"/>
      <telerikChart:PaletteEntry Fill="#FFFA6F5E"/>
      <telerikChart:PaletteEntry Fill="#FF21B573"/>
      <telerikChart:PaletteEntry Fill="#FF88CA2A"/>
      <telerikChart:PaletteEntry Fill="#FFFF921E"/>
      <telerikChart:PaletteEntry Fill="#FF006968"/>
      <telerikChart:PaletteEntry Fill="#FF7A6CC4"/>
    </telerikChart:PaletteEntryCollection>
  </telerikChart:ChartPalette.SeriesEntries>
</telerikChart:ChartPalette>

Do not hesitate to experiment with this tasty new feature by taking your hands on our fresh Mango SP1 release. We will be more than happy to hear your feedback on what further may be added as new chart features and what may be improved on existing ones.


About the Author

Georgi Atanasov


Related Posts

Comments

Comments are disabled in preview mode.