ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  24 months sale data display in bar chart
Posted by April on Apr-06-2011 10:30
Hi Peter,

I have problem showing 24 months sale data in bar chart. My 24 months came from 12 months from each year..Last say for year 2010..i want my data to display from Jan 2009 to Dec 2010..24 months period. but my data will return 1-12 from 2009 and 1-12 from 2010..not 1-24..how should i go about this? Pls help me see my array data below.Many thanks.


        string[] labels = {"1", "2", "3", "4", "5", "6", "7", "8",
        "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24"};
        double[] Currentvalues = dtCurrentTotalSold.getCol(0);    // data for 2009
        double[] Currentmonths = dtCurrentTotalSold.getCol(1);   // 1 - 12 representing the month of the value
        double[] Currentvalues1 = dtCurrentTotalSold1.getCol(0);    // data for 2010
        double[] Currentmonths1 = dtCurrentTotalSold1.getCol(1);

     double[] data = new double[24];
        for (int i = 0; i < data.Length; ++i)
        {
            data[i] = Chart.NoValue;

        }


        //put your values in the suitable array positions based on the month
        for (int i = 0; i < Currentvalues.Length; ++i)
        {
            data[(int)Currentmonths[i] - 1] = Currentvalues[i];

        }

  Re: 24 months sale data display in bar chart
Posted by Peter Kwan on Apr-07-2011 01:41
Hi April,

You just need to copy your data to the correct position of the data arrays.

double[] data = new double[24];

//copy CurrentValues to position 0 to 11
for (int i = 0; i < Currentvalues.length; ++i)
     data[Currentmonths[i] - 1] = Currentvalues[i];

//Copy CurrentValues1 to position 12 to 23
for (int i = 0; i < Currentvalues1.length; ++i)
     data[Currentmonths1[i] + 11] = Currentvalues1[i];

Hope this can help.

Regards
Peter Kwan

  Re: 24 months sale data display in bar chart
Posted by April on Apr-07-2011 10:09
Thx Peter..will try today..have a nice day to you.

  Re: 24 months sale data display in bar chart
Posted by April on Apr-11-2011 15:25
Hi Peter,

I tried and it working fine. Thanks again for your help..Now i wanted to host chart director chart in share point server. How should i deploy? I have created asp.net application for chart . Any sugesstion? Have a nice day.

April