Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
270
Stacked Chart Data Source
posted

Hi,

I need to create a Stacked Chart.

My object looks like this 

Product     Year     Sales

A               2010    1000

A               2011   2000

B               2010    1000

B               2011   2000

The chart needs to be have X axis = product and stacked by year (there could be a variable number of years).

Do I need to pivot the data with something similar to as shown in this article- 

http://techbrij.com/pivot-c-array-datatable-convert-column-to-row-linq

Is there any way to use the object I have to create a stack chart without pivoting it?

Regards,

Naresh

  • 2575
    Offline posted

    Hello Naresh,

    You are correct, you will need to pivot the data, since each StackedFragmentSeries must point to a separate numeric member of the data.

    Please let me know if I can further assist you.